Skip to content

Commit

Permalink
change syntax for shell to #ident
Browse files Browse the repository at this point in the history
  • Loading branch information
jku20 committed Jul 11, 2024
1 parent 155412e commit b35bb30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fud2/fud-core/src/script/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ impl ScriptContext {
}
}

/// If `{$ident}` is a substring of `cmd` and `("ident", "value")` is in `mapping`, returns a
/// string identical to `cmd` except for all instances `{$ident}` replaced with `value`.
/// If `#ident` is a substring of `cmd` and `("ident", "value")` is in `mapping`, returns a
/// string identical to `cmd` except for all instances `#ident` replaced with `value`.
fn substitute_shell_text(cmd: &str, mapping: &[(&str, &str)]) -> String {
let mut cur = cmd.to_string();
for (i, v) in mapping {
let substr = format!("{{${}}}", i);
let substr = format!("#{}", i);
cur = cur.replace(&substr, v);
}
cur
Expand Down

0 comments on commit b35bb30

Please sign in to comment.