vs-shell-format icon indicating copy to clipboard operation
vs-shell-format copied to clipboard

quoting issues using the formatter

Open Morriz opened this issue 3 years ago • 0 comments

We see quoting issues after activating this extension

Variables that were quoted before, are quoted again, leading to incorrect commands. Example:

mount="-v /tmp:/tmp"
cmd="bash"
conditional_flag=''
docker run $mount $conditional_flag busybox bash -c $cmd

becomes

docker run "$mount" "$conditional_flag" busybox bash -c "$cmd"

which translates to

docker run '-v /tmp:/tmp' '' busybox bash -c 'echo ok'

which makes the comand invalid because of the empty quotes

Morriz avatar Dec 20 '22 18:12 Morriz