diff --git a/crates/deno_task_shell/src/parser.rs b/crates/deno_task_shell/src/parser.rs index c438ece..2745ca0 100644 --- a/crates/deno_task_shell/src/parser.rs +++ b/crates/deno_task_shell/src/parser.rs @@ -1507,7 +1507,7 @@ fn parse_quoted_word(pair: Pair) -> Result { parts.push(WordPart::Command(command)); } Rule::VARIABLE => { - parts.push(WordPart::Variable(part.as_str()[1..].to_string())) + parts.push(WordPart::Variable(part.as_str().to_string())) } Rule::QUOTED_CHAR => { if let Some(WordPart::Text(ref mut s)) = parts.last_mut() { diff --git a/crates/tests/src/lib.rs b/crates/tests/src/lib.rs index 65c5ea7..45ab92e 100644 --- a/crates/tests/src/lib.rs +++ b/crates/tests/src/lib.rs @@ -74,6 +74,12 @@ async fn commands() { .run() .await; + TestBuilder::new() + .command(r#"FOO=1; echo "$FOO""#) + .assert_stdout("1\n") + .run() + .await; + TestBuilder::new() .command("echo 'a/b'/c") .assert_stdout("a/b/c\n")