Skip to content

Commit 959a95b

Browse files
authored
Merge pull request #61 from DouglasNeuroInformatics/dev
fix: adjust shell scripts to remove dependency on coreutils
2 parents bc80797 + ab67f45 commit 959a95b

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/cli/bin/libnest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
DIR="$(dirname "$(realpath "$0")")"
3+
DIR=$(cd "$(dirname "$0")" && pwd)
44
PARENT_DIR="$(dirname "$DIR")"
55

66
node --enable-source-maps "${PARENT_DIR}"/libnest.js "$@"

src/cli/bin/libnest-build

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
DIR="$(dirname "$(realpath "$0")")"
3+
DIR=$(cd "$(dirname "$0")" && pwd)
44
PARENT_DIR="$(dirname "$DIR")"
55

66
RUNTIME_ARGS=""
@@ -14,10 +14,14 @@ case "$LIBNEST_JAVASCRIPT_RUNTIME" in
1414
RUNTIME_ARGS="-A --unstable-sloppy-imports"
1515
;;
1616
*)
17-
echo "Error: Invalid runtime '$LIBNEST_JAVASCRIPT_RUNTIME': must be 'node' or 'deno'" >&2
17+
echo "Error: Invalid runtime '$LIBNEST_JAVASCRIPT_RUNTIME': must be 'node', 'bun', or 'deno'" >&2
1818
exit 1
1919
;;
2020
esac
2121

22-
eval $LIBNEST_JAVASCRIPT_RUNTIME $RUNTIME_ARGS "${PARENT_DIR}"/libnest-build.js "$@"
22+
if ! command -v "$LIBNEST_JAVASCRIPT_RUNTIME" >/dev/null 2>&1; then
23+
echo "Error: Runtime '$LIBNEST_JAVASCRIPT_RUNTIME' not found in PATH" >&2
24+
exit 1
25+
fi
2326

27+
exec "$LIBNEST_JAVASCRIPT_RUNTIME" $RUNTIME_ARGS "${PARENT_DIR}/libnest-build.js" "$@"

src/cli/bin/libnest-dev

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
DIR="$(dirname "$(realpath "$0")")"
3+
DIR=$(cd "$(dirname "$0")" && pwd)
44
PARENT_DIR="$(dirname "$DIR")"
55

66
NO_WATCH=false
@@ -26,9 +26,14 @@ case "$LIBNEST_JAVASCRIPT_RUNTIME" in
2626
RUNTIME_ARGS="-A --unstable-sloppy-imports"
2727
;;
2828
*)
29-
echo "Error: Invalid runtime '$LIBNEST_JAVASCRIPT_RUNTIME': must be 'node' or 'deno'" >&2
29+
echo "Error: Invalid runtime '$LIBNEST_JAVASCRIPT_RUNTIME': must be 'node', 'bun', or 'deno'" >&2
3030
exit 1
3131
;;
3232
esac
3333

34-
eval $LIBNEST_JAVASCRIPT_RUNTIME $RUNTIME_ARGS "${PARENT_DIR}/libnest-dev.js" "$@"
34+
if ! command -v "$LIBNEST_JAVASCRIPT_RUNTIME" >/dev/null 2>&1; then
35+
echo "Error: Runtime '$LIBNEST_JAVASCRIPT_RUNTIME' not found in PATH" >&2
36+
exit 1
37+
fi
38+
39+
exec $LIBNEST_JAVASCRIPT_RUNTIME $RUNTIME_ARGS "${PARENT_DIR}/libnest-dev.js" "$@"

0 commit comments

Comments
 (0)