feat: add a new flag overwrite for build command #1916
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number: Issue #1913 ADDON-83527
PR Type
What kind of change does this PR introduce?
Summary
Changes
Previously, when a user specified a custom build path using the
--o/--outputparameter, the entireoutput_pathwas cleaned before building the add-on. This could result in unintended loss of existing files in that directory.Therefore, added a new flag
--overwritefor the build command. Now, we only attempt to clean theoutput_path/<ta_name>directory if the --overwrite flag is provided. If the --overwrite flag is not passed and theoutput_path/<ta_name>directory already exists, the build will fail and prompt the user to either pass the --overwrite flag or choose a different output path.User experience
User files and directories will no longer be unintentionally deleted when a custom build path is provided using the
--o/--outputparameter. If theoutput_path/<ta_name>directory already exists, users must explicitly pass the--overwriteflag to allow it to be overwritten.Checklist
If an item doesn't apply to your changes, leave it unchecked.
Review
Tests
See the testing doc.
Demo/meeting:
Reviewers are encouraged to request meetings or demos if any part of the change is unclear