Skip to content

Deletion of pre-existing route folders in urara.clean() #4

@nberlette

Description

@nberlette

urara/urara.js

Lines 86 to 96 in b5520f9

const clean = async () => {
fs.rm('static', { recursive: true }).then(log('yellow', 'remove dir', 'static')).catch(error)
fs.readdir('src/routes', { withFileTypes: true }).then(files =>
files.forEach(file => {
if (file.isDirectory()) {
const dest = path.join('src/routes', file.name)
fs.rm(dest, { recursive: true }).then(log('yellow', 'remove dir', dest)).catch(error)
}
})
)
}

I noticed that pre-existing folders in the routes directory are blown away by the urara.clean function, as you can see in the section of code highlighted above. Urara apparently just deletes all routes folders arbitrarily, without checking if it was a route that it created or not.

This means if I had a subfolder for photos, for example, after running the dev server urara would destroy them and not even realize it made a mistake. This has huge implications down the line. Unfortunately I don't have the bandwidth to draft a PR right now, but I'll still try to squeeze it in.

That being said: wonderful project you have here so far, I'm quite eager to try it in production as soon as possible 😉

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions