diff options
author | 2021-11-04 21:00:44 -0700 | |
---|---|---|
committer | 2021-11-04 21:00:44 -0700 | |
commit | e409148941d161b3f9e11012a73294c1d40af910 (patch) | |
tree | b46af31c25c58b4a18018ded1893b96ce143188e /integration | |
parent | d44abd8e4d6d46b41862eeeee317d10de73790da (diff) | |
download | bun-e409148941d161b3f9e11012a73294c1d40af910.tar.gz bun-e409148941d161b3f9e11012a73294c1d40af910.tar.zst bun-e409148941d161b3f9e11012a73294c1d40af910.zip |
[bun run] Fix bug with quotes and spaces
Fixes #53
Diffstat (limited to 'integration')
-rw-r--r-- | integration/apps/bun-run-check-package.json | 3 | ||||
-rw-r--r-- | integration/apps/bun-run-check.sh | 24 |
2 files changed, 20 insertions, 7 deletions
diff --git a/integration/apps/bun-run-check-package.json b/integration/apps/bun-run-check-package.json index 6fabca272..b6eeda046 100644 --- a/integration/apps/bun-run-check-package.json +++ b/integration/apps/bun-run-check-package.json @@ -1,6 +1,7 @@ { "name": "check", "scripts": { - "this-should-work": "echo \"✅ bun run test passed!\"" + "this-should-work": "echo \"✅ bun run test passed!\"", + "argv": "node -e 'console.log(process.argv)'" } } diff --git a/integration/apps/bun-run-check.sh b/integration/apps/bun-run-check.sh index b6e9edda9..dca1db6ae 100644 --- a/integration/apps/bun-run-check.sh +++ b/integration/apps/bun-run-check.sh @@ -1,6 +1,6 @@ #!/bin/bash -killall -9 $(basename $BUN_BIN) || echo ""; +(killall -9 $(basename $BUN_BIN) || echo "") >/dev/null 2>&1 # https://github.com/Jarred-Sumner/bun/issues/40 # Define a function (details aren't important) @@ -8,24 +8,36 @@ fn() { :; } # The important bit: export the function export -f fn - rm -rf /tmp/bun-run-check mkdir -p /tmp/bun-run-check - cp ./bun-run-check-package.json /tmp/bun-run-check/package.json cd /tmp/bun-run-check $BUN_BIN run bash -- -c "" -if (( $? )); then +if (($?)); then echo "Bash exported functions are broken" exit 1 fi -$BUN_BIN run --silent this-should-work +# https://github.com/Jarred-Sumner/bun/issues/53 +rm -f /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt >/dev/null 2>&1 -exit $? +$BUN_BIN run --silent argv -- foo bar baz >/tmp/bun-run-out.txt +npm run --silent argv -- foo bar baz >/tmp/bun-run-out.expected.txt +cmp -s /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt +if (($?)); then + echo "argv failed" + exit 1 +fi +$BUN_BIN run --silent this-should-work + +if (($?)); then + echo "this-should work failed" + exit 1 +fi +exit 0 |