charmbracelet / freeze

Generate images of code and terminal output 📸
MIT License
3.24k stars 55 forks source link

fix: properly parse exec #40

Closed caarlos0 closed 6 months ago

caarlos0 commented 6 months ago

Split by space is not always correct, for instance:

gum format "foo bar"

would be split in:

["gum" "format" "\"foo" "bar\""]

Using the shellwords parse it would correctly split it to:

["gum" "format" "foo bar"]
caarlos0 commented 6 months ago

ps: we could use testscripts for these integration tests I think, so we could get coverage of them too

https://github.com/rogpeppe/go-internal/tree/master/testscript https://github.com/charmbracelet/soft-serve/blob/main/testscript/script_test.go