Closed luangong closed 5 months ago
Running the following code with deno:
import $ from 'https://deno.land/x/dax/mod.ts'; await $`echo \( foo bar \)`;
An error will be produced:
error: Uncaught (in promise) "Unexpected character.\n ( bar )\n ~"
The expected output is:
( foo bar )
Given the following content of deno.json:
deno.json
{ "tasks": { "paren": "echo ( foo bar )", "paren2": "echo \\( foo bar \\)", "paren3": "echo \\(\nfoo bar\n\\)" } }
And running deno task paren2 and deno task paren3 both produce the expected output:
deno task paren2
deno task paren3
$ deno task paren2 Task paren2 echo \( foo bar \) ( foo bar ) $ deno task paren3 Task paren3 echo \( foo bar \) ( foo bar )
Support for escaped parentheses was added in https://github.com/denoland/deno_task_shell/pull/99, but it seems that https://github.com/dsherret/dax/pull/232 broke it.
Related:
It seems that it requires double-escaping. The following code works:
import $ from 'https://deno.land/x/dax/mod.ts'; await $`echo \\( foo bar \\)`;
Running the following code with deno:
An error will be produced:
The expected output is:
Given the following content of
deno.json
:And running
deno task paren2
anddeno task paren3
both produce the expected output:Support for escaped parentheses was added in https://github.com/denoland/deno_task_shell/pull/99, but it seems that https://github.com/dsherret/dax/pull/232 broke it.
Related: