mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 07:30:13 +01:00
Fix single quote external interpolation (#4867)
This commit is contained in:
parent
d0cbb2d12c
commit
7773c4cd4d
@ -263,7 +263,11 @@ pub fn parse_external_call(
|
||||
let contents = working_set.get_span_contents(*span);
|
||||
|
||||
if contents.starts_with(b"$") || contents.starts_with(b"(") {
|
||||
let (arg, err) = parse_expression(working_set, &[*span], true);
|
||||
let (arg, err) = parse_dollar_expr(working_set, *span);
|
||||
error = error.or(err);
|
||||
args.push(arg);
|
||||
} else if contents.starts_with(b"(") {
|
||||
let (arg, err) = parse_full_cell_path(working_set, None, *span);
|
||||
error = error.or(err);
|
||||
args.push(arg);
|
||||
} else {
|
||||
|
@ -83,8 +83,13 @@ fn execute_binary_in_string() {
|
||||
assert_eq!(actual.out, "$0");
|
||||
}
|
||||
|
||||
//FIXME: jt - this is blocked on https://github.com/nushell/engine-q/issues/875
|
||||
#[ignore]
|
||||
#[test]
|
||||
fn single_quote_dollar_external() {
|
||||
let actual = nu!(cwd: ".", r#"let author = 'JT'; ^echo $'foo=($author)'"#);
|
||||
|
||||
assert_eq!(actual.out, "foo=JT");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn redirects_custom_command_external() {
|
||||
let actual = nu!(cwd: ".", r#"def foo [] { nu --testbin cococo foo bar }; foo | str length"#);
|
||||
|
Loading…
Reference in New Issue
Block a user