-
Notifications
You must be signed in to change notification settings - Fork 13
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(lib): simplify and improve sh! macro #195
fix(lib): simplify and improve sh! macro #195
Conversation
✅ Deploy Preview for coffee-docs canceled.
|
} | ||
return Err(CoffeeError::new(2, &content)); | ||
let mut cmd = Command::new("sh"); | ||
cmd.args(&["-c", &script]); |
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.
Ah nice trick!
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.
LGTM
I have just a comment on the expect
call, we can return an error and avoid panicking? if this panic happens in the httpd can cause problem (maybe)
thanks! VERY NICE IMPROVEMENT
@jackstar12 Are you still working on this? I would really love to merge went he review is addressed |
yes, I was on vacation this week, I`ll get to it in the next few days |
instead of trying to manually parse the script and potentially making errors, let the actual `sh` command do the work correctly
361a5db
to
785e8ac
Compare
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.
Thanks for working on this and fixing my bad sh macros!
ACK 785e8ac
working on #194 I noticed a issue with the
sh
macro when trying to execute a script that uses a pipe. Looking into the implementation I saw that it tries to manually parse out the commands, which is pretty error prone. so, instead of trying to manually parse the script and potentially making errors, let the actualsh
command do the work correctly