mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2026-02-02 07:35:10 +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
|
|
@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [0.7.4] - 2025-04-10
|
## [0.7.4] - 2025-04-10 [YANKED]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -707,7 +707,10 @@ pub fn shell_evaluated_commands(shell: &str, command: &str, success: bool) {
|
||||||
|
|
||||||
let print = match shell {
|
let print = match shell {
|
||||||
"bash" => {
|
"bash" => {
|
||||||
let command = command.replace("$", "\\$").replace("`", "\\`");
|
let command = command
|
||||||
|
.replace("$", "\\$")
|
||||||
|
.replace("`", "\\`")
|
||||||
|
.replace("\"", "\\\"");
|
||||||
let template = BashTemplate {
|
let template = BashTemplate {
|
||||||
command: &command,
|
command: &command,
|
||||||
cd: cd.as_deref(),
|
cd: cd.as_deref(),
|
||||||
|
|
@ -715,7 +718,10 @@ pub fn shell_evaluated_commands(shell: &str, command: &str, success: bool) {
|
||||||
template.render().unwrap()
|
template.render().unwrap()
|
||||||
}
|
}
|
||||||
"zsh" => {
|
"zsh" => {
|
||||||
let command = command.replace("$", "\\$").replace("`", "\\`");
|
let command = command
|
||||||
|
.replace("$", "\\$")
|
||||||
|
.replace("`", "\\`")
|
||||||
|
.replace("\"", "\\\"");
|
||||||
let template = ZshTemplate {
|
let template = ZshTemplate {
|
||||||
command: &command,
|
command: &command,
|
||||||
cd: cd.as_deref(),
|
cd: cd.as_deref(),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
history -s {{ command }};
|
history -s "{{ command }}";
|
||||||
|
|
||||||
{%- if let Some(cd) = self.cd %}
|
{%- if let Some(cd) = self.cd %}
|
||||||
cd {{ cd }}
|
cd {{ cd }}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
print -s {{ command }};
|
print -s "{{ command }}";
|
||||||
|
|
||||||
{%- if let Some(cd) = self.cd %}
|
{%- if let Some(cd) = self.cd %}
|
||||||
cd {{ cd }}
|
cd {{ cd }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue