aspect-build / aspect-build/aspect-cli-legacy
[FR]: `aspect init` should handle a `SIGINT` signal (keyboard interrupt / `CTRL +C`)
- Dominant language
- Go
- Stars
- 3
- Forks
- 1
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 3
Description
### What is the current behavior?
Today if I run `aspect init` it clones https://github.com/aspect-build/aspect-workflows-template: https://github.com/aspect-build/aspect-cli/blob/39875c856b24e185d93bcd0cbb1956245792767a/pkg/aspect/init/init.go#L76 and enters interactive mode. If a user do not proceed (hits `CTRL + C`) it does not gracefully handle this event.
It exits with status code = 1, prints `Error: user aborted` and leaves the cloned github.com directory in the current dir.
### Describe the feature
When an user aborts the init operation, it should cleanup changes done to the current workdir and do not treat it as an error.
Contributor guide
Research direction
Start at pkg/aspect/init/init.go around line 76, where aspect init clones the aspect-workflows-template and enters interactive mode. Reproduce the operation with CTRL+C, then verify that the cloned github.com directory is cleaned up and the command exits without treating the abort as an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100