charmbracelet / freeze

Generate images of code and terminal output 📸
MIT License
2.98k stars 50 forks source link

Don't abort if exit code is nonzero #112

Open TylerJang27 opened 1 month ago

TylerJang27 commented 1 month ago

Is your feature request related to a problem? Please describe. Please add a flag (or default behavior) to not error when the --execute command exits with a nonzero status. Right now if I do something like freeze --execute "mkdir .", I get the error:

   ERROR  Something went wrong

  exit status 1

Describe the solution you'd like Sometimes I want to capture an image output of commands that have a nonzero status.

Describe alternatives you've considered I've tried doing something like wrapping the execute in bash -c '... || true', but depending on the complexity of the command, sometimes this doesn't work and it isn't very scalable.

Additional context Love the tool, but would like to see a few more refinements for --execute support!