-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix escaping of shell commands #7
Fix escaping of shell commands #7
Conversation
src/HotelCalifornia/Exec.hs
Outdated
@@ -38,15 +39,18 @@ parseExecArgs = do | |||
runExecArgs :: ExecArgs -> IO () | |||
runExecArgs ExecArgs {..} = do | |||
let script = | |||
unwords $ NEL.toList execArgsScript | |||
Escape.escapeMany $ NEL.toList execArgsScript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautiful thank you 🙏🏻
Before this change, the `hotel` executable wouldn't handle spaces in arguments correctly. A simple example is: ```bash $ hotel exec echo ' a' ``` Before this change that would print: ``` a ``` … and after this change it correctly prints: ``` a ```
Fixes #10 |
… for when the user wants to run an arbitrary shell command This also fixes the command-line parser so that you don't need to add `--` before the command to avoid confusing options.
63e12cf
to
adcb53e
Compare
I added support for a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic. Thanks so much!!
Note that I can't merge so you'll have to merge this |
Released as 0.0.2.0, thank you! |
Before this change, the
hotel
executable wouldn't handle spaces in arguments correctly. A simple example is:Before this change that would print:
… and after this change it correctly prints: