anishathalye / dotbot

A tool that bootstraps your dotfiles ⚡️
MIT License
6.91k stars 288 forks source link

How to "exit" in the middle of the execution? #296

Closed Vafa-Andalibi closed 2 years ago

Vafa-Andalibi commented 2 years ago

Hi, first, thanks for this useful tool. I'm trying to stop the execution during one of the shell configs, and ask user to "do something and run the installer again". But I can't exit during the execution. How can I do that?

anishathalye commented 2 years ago

Could you share a bit more detail about what you're trying to accomplish?

If you have a sequence of shell actions, like

- shell:
    - command_one args
    - command_two

As soon as one of them returns a non-zero exit code, it'll skip the remaining ones. But Dotbot will still run other actions that come after the shell: block.

Would it solve your problem if we added a command-line flag to Dotbot to make it bail out if any action fails?

Vafa-Andalibi commented 2 years ago

oh I see, I actually achieved what I wanted using profiles. So all good now! thanks again!