-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI - spacetime generate
always deletes stale files
#1774
Conversation
.iter() | ||
.any(|x| x.file_name().unwrap() == path.file_name().unwrap()) | ||
{ | ||
// TODO: We should probably just delete all generated files before we generate any, rather than selectively deleting some afterward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bfops Yeah hold on I think there are some bugs here. We only prompt users after we've already done the generation? That seems wrong to me. Also we should only be replacing files which contain our special header, not just overwriting whatever file is already there. Can we fix those issues here or do you want to do a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do those things in a separate PR since they're not API-breaking.
Also, it looks like we have the capacity to generate files in subdirectories, but it's not clear to me that we can delete them from subdirectories..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #1786
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this - we're fixing the other existing issues in a separate PR
Description of Changes
spacetime generate --delete-files
deletes all files in the target directory that start with the SpacetimeDB autogenerated file header. This PR makes turns that behavior permanently on, and removes the flag.We think this is unlikely to negatively affect users, since it only deletes files that start with the header that is automatically generated by SpacetimeDB. If users do experience negative effects, we can add a flag to disable this behavior.
API and ABI breaking changes
Yes. We no longer support
--delete-files
.Expected complexity level and risk
2
Testing