Skip to content

Commit

Permalink
npm,npx: quote argument expansions
Browse files Browse the repository at this point in the history
Using $@ instead of "$@" means

    npm "foo bar"

will be expanded to

    npm foo bar

unexpectedly.

Also, pwd output may contain spaces.

Caught by shellcheck.

Change-Id: I045ac3289e65698c6c1fb1396420fba8fe0473e1
Reviewed-on: https://go-review.googlesource.com/c/website/+/635615
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Filippo Valsorda <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
  • Loading branch information
FiloSottile authored and gopherbot committed Dec 12, 2024
1 parent 22adbef commit b7e178d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions npm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

docker run \
--rm \
--volume $(pwd):/workspace \
--volume "$(pwd)":/workspace \
--workdir /workspace \
--env NODE_OPTIONS="--experimental-vm-modules --no-warnings" \
--entrypoint npm \
node:16.13.1-alpine3.14 \
$@
"$@"
4 changes: 2 additions & 2 deletions npx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

docker run \
--rm \
--volume $(pwd):/workspace \
--volume "$(pwd)":/workspace \
--workdir /workspace \
--env NODE_OPTIONS="--experimental-vm-modules --no-warnings" \
--entrypoint npx \
node:16.13.1-alpine3.14 \
$@
"$@"

0 comments on commit b7e178d

Please sign in to comment.