Skip to content
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

sandbox mode #75

Open
haoliangyu opened this issue May 3, 2021 · 0 comments
Open

sandbox mode #75

haoliangyu opened this issue May 3, 2021 · 0 comments
Assignees

Comments

@haoliangyu
Copy link
Member

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:

  1. Create a temporary work directory
  2. Create all new files
  3. Copy all files to change
  4. Change files
  5. 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.

@haoliangyu haoliangyu self-assigned this May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant