vadimdemedes / pastel

🎨 Next.js-like framework for CLIs made with Ink
https://term.ink/pastel
MIT License
2.18k stars 36 forks source link

Fix unlinking on exit #22

Closed zimme closed 5 years ago

zimme commented 5 years ago

As the same handler for unlinking is used for exit and SIGINT/SIGTERM we need to actually exit the process in case of SIGINT and SIGTERM after unlinking.

Only synchronous function calls are supported in exit handlers so use execa.sync and check exit code of that to see if we should exit with an exit code or not, based on if unlink worked.

zimme commented 5 years ago

The current implementation stops ctrl+c from exiting.

vadimdemedes commented 5 years ago

Thanks!