Skip to content

Commit 90d3346

Browse files
authored
fix: variable in quoted string (#171)
1 parent aa5a6ae commit 90d3346

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crates/deno_task_shell/src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ fn parse_quoted_word(pair: Pair<Rule>) -> Result<WordPart> {
15071507
parts.push(WordPart::Command(command));
15081508
}
15091509
Rule::VARIABLE => {
1510-
parts.push(WordPart::Variable(part.as_str()[1..].to_string()))
1510+
parts.push(WordPart::Variable(part.as_str().to_string()))
15111511
}
15121512
Rule::QUOTED_CHAR => {
15131513
if let Some(WordPart::Text(ref mut s)) = parts.last_mut() {

crates/tests/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ async fn commands() {
7474
.run()
7575
.await;
7676

77+
TestBuilder::new()
78+
.command(r#"FOO=1; echo "$FOO""#)
79+
.assert_stdout("1\n")
80+
.run()
81+
.await;
82+
7783
TestBuilder::new()
7884
.command("echo 'a/b'/c")
7985
.assert_stdout("a/b/c\n")

0 commit comments

Comments
 (0)