fix(task): preserve trailing backslashes in task arguments (#34505)
Running `deno task <name> <args...>` failed with an "Expected closing double quote" parse error when an argument ended in a backslash, which is a common shape for Windows paths like `.\dist\`. The argv wrapper in `get_script_with_args` double-quoted each argument and only escaped `"`, `$`, and `` ` ``, so a trailing `\` ended up escaping the closing quote. The task shell's double-quoted-string scanner also accumulates its `was_escape` flag across consecutive backslashes, so there is no way to safely terminate a double-quoted string ending in backslashes from the caller side. Wrap each argument in single quotes instead. Single-quoted strings in `deno_task_shell` preserve their contents literally, so backslashes, dollar signs, and backticks all pass through without interpretation. Embedded single quotes use the POSIX `'"'"'` idiom (close, double-quoted `'`, reopen). Fixes #31453
B
Bartek Iwańczuk committed
e07f52b1d03c8e17b0eada8b94066169f0ae2c9e
Parent: d84bfe5
Committed by GitHub <noreply@github.com>
on 5/30/2026, 6:50:06 AM