aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-29 19:17:44 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-29 19:17:44 -0700
commit95d2860930f306bfc7c2eb68d13ede9a56f949e0 (patch)
treebf53a8a9bdd07247793d925b6aba48ad40decb73
parent70db76a798ca7293bc012c7c64e768f6a4cca7b6 (diff)
downloadbun-95d2860930f306bfc7c2eb68d13ede9a56f949e0.tar.gz
bun-95d2860930f306bfc7c2eb68d13ede9a56f949e0.tar.zst
bun-95d2860930f306bfc7c2eb68d13ede9a56f949e0.zip
Add integration test that verifies bash exported functions work in `bun run`
-rw-r--r--integration/apps/bun-run-check.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/integration/apps/bun-run-check.sh b/integration/apps/bun-run-check.sh
index 72281c266..b6e9edda9 100644
--- a/integration/apps/bun-run-check.sh
+++ b/integration/apps/bun-run-check.sh
@@ -2,13 +2,29 @@
killall -9 $(basename $BUN_BIN) || echo "";
+# https://github.com/Jarred-Sumner/bun/issues/40
+# Define a function (details aren't important)
+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 run --silent this-should-work
+
+$BUN_BIN run bash -- -c ""
+
+if (( $? )); then
+ echo "Bash exported functions are broken"
+ exit 1
+fi
+
+$BUN_BIN run --silent this-should-work
+
exit $?