Skip to content

Commit f833fe6

Browse files
feat(ksuid): update CLI wrapper
- check if `bun` is available, otherwise fallback to `node`
1 parent cbbb33f commit f833fe6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: packages/ksuid/bin/ksuid

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22

33
# https://stackoverflow.com/a/246128/294515
44
SOURCE="${BASH_SOURCE[0]}"
5-
while [ -h "$SOURCE" ]; do
5+
while [ -L "$SOURCE" ]; do
66
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
77
SOURCE="$(readlink "$SOURCE")"
88
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
99
done
1010
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
11+
DIR="$(dirname $DIR)"
1112

12-
/usr/bin/env node "$DIR/../cli.js" "$DIR" "$@"
13+
# prefer using bun
14+
if [ -x "$(command -v bun)" ]; then
15+
CMD=bun
16+
else
17+
CMD=node
18+
fi
19+
20+
/usr/bin/env $CMD "$DIR/cli.js" "$DIR" "$@"

0 commit comments

Comments
 (0)