Open llimllib opened 1 year ago
Correct, it's intended to prevent accidental behavior such as a file generated from a previous run causing a Go compilation error.
What are the better approaches?
.up.go
generated files before a build?What about this:
out-dir
is an empty directory, proceed normallypotentially with a --force-delete
or similar option to allow the user to skip the warning; alternatively you could just leave it up to their responsibility to clear the directory before building if they don't want to receive the prompt
in #83 we decided to aim for a nondestructive strategy rather than asking for permission to delete, which is not a great DX.
The next question is, how?
Given a build directory build
, we want to build our app without interference from old versions of the app, and also without destroying all the files within (the current, "destructive" strategy).
A simple strategy would be:
pushup build
, create a GUID g
and create a folder build/<g>
, then build within that folderThat might ultimately create more files than are strictly necessary, but it's hard for me to see how we can safely re-use a directory that's already been used?
Right now the first step in the build process is to delete everything in whatever directory you give it for an output directory, this is probably a footgun:
https://github.com/adhocteam/pushup/blob/7b9ec07d4ce06d3cf9fc9fc3d2e0bca92856ee2c/main.go#L303
Is there any reason to delete files other than ones that conflict with what pushup is building?