mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
fix: multiline commands are executed twice
This commit is contained in:
parent
cd49ea3d9b
commit
969c372703
4 changed files with 11 additions and 5 deletions
|
|
@ -707,7 +707,10 @@ pub fn shell_evaluated_commands(shell: &str, command: &str, success: bool) {
|
|||
|
||||
let print = match shell {
|
||||
"bash" => {
|
||||
let command = command.replace("$", "\\$").replace("`", "\\`");
|
||||
let command = command
|
||||
.replace("$", "\\$")
|
||||
.replace("`", "\\`")
|
||||
.replace("\"", "\\\"");
|
||||
let template = BashTemplate {
|
||||
command: &command,
|
||||
cd: cd.as_deref(),
|
||||
|
|
@ -715,7 +718,10 @@ pub fn shell_evaluated_commands(shell: &str, command: &str, success: bool) {
|
|||
template.render().unwrap()
|
||||
}
|
||||
"zsh" => {
|
||||
let command = command.replace("$", "\\$").replace("`", "\\`");
|
||||
let command = command
|
||||
.replace("$", "\\$")
|
||||
.replace("`", "\\`")
|
||||
.replace("\"", "\\\"");
|
||||
let template = ZshTemplate {
|
||||
command: &command,
|
||||
cd: cd.as_deref(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue