-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The add and remove command is directly updating the js files. If there is an error and the process is forced to exit, it will leave some files changed and some unchanged. This will pollute the user's codebase and it is difficult to restore if the user is unfamiliar with the internal process of Koop CLI. Ideally, the change should be generated first and then applied to the files if the first step succeeds.
In the sandbox mode, the CLI tool should generate all changed files and new files in a temporary work directory. It should take several steps:
- Create a temporary work directory
- Create all new files
- Copy all files to change
- Change files
- Move all changes to the actual work directory
If there is an error in step 1 to 4, or the user specifies the --sandbox flag, it should skip the final step. This will keep the user's codebase in the original state at problematic situations.
Metadata
Metadata
Assignees
Labels
No labels