aspect-build / aspect-cli

correct, fast, usable: choose three
https://aspect.build/cli
Apache License 2.0
84 stars 19 forks source link

[FR]: `aspect init` should handle a `SIGINT` signal (keyboard interrupt / `CTRL +C`) #721

Open albertocavalcante opened 2 months ago

albertocavalcante commented 2 months ago

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.