niahere 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/nia +18 -9
- package/package.json +1 -1
package/bin/nia
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
# Check if bun is available (including ~/.bun/bin which may not be in PATH yet)
|
|
4
|
+
BUN_CMD=""
|
|
5
|
+
if command -v bun >/dev/null 2>&1; then
|
|
6
|
+
BUN_CMD="bun"
|
|
7
|
+
elif [ -x "$HOME/.bun/bin/bun" ]; then
|
|
8
|
+
BUN_CMD="$HOME/.bun/bin/bun"
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
if [ -z "$BUN_CMD" ]; then
|
|
3
12
|
echo "niahere requires Bun runtime."
|
|
4
13
|
printf "Install Bun now? (y/n) "
|
|
5
14
|
read -r answer
|
|
6
15
|
if [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
|
|
7
16
|
curl -fsSL https://bun.sh/install | bash
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if ! command -v bun >/dev/null 2>&1; then
|
|
17
|
+
BUN_CMD="$HOME/.bun/bin/bun"
|
|
18
|
+
if [ ! -x "$BUN_CMD" ]; then
|
|
11
19
|
echo "Bun install failed. Install manually: curl -fsSL https://bun.sh/install | bash"
|
|
12
20
|
exit 1
|
|
13
21
|
fi
|
|
22
|
+
echo ""
|
|
14
23
|
echo "Bun installed. Continuing..."
|
|
24
|
+
echo "(Open a new terminal for bun to be in PATH permanently)"
|
|
25
|
+
echo ""
|
|
15
26
|
else
|
|
16
27
|
echo ""
|
|
17
28
|
echo "Install manually: curl -fsSL https://bun.sh/install | bash"
|
|
@@ -20,14 +31,12 @@ if ! command -v bun >/dev/null 2>&1; then
|
|
|
20
31
|
fi
|
|
21
32
|
fi
|
|
22
33
|
|
|
23
|
-
# Resolve the real path of this script (follows
|
|
24
|
-
REAL="$(realpath "$0" 2>/dev/null)" || REAL="$
|
|
25
|
-
# Go up from bin/ to package root
|
|
34
|
+
# Resolve the real path of this script (follows symlinks)
|
|
35
|
+
REAL="$(realpath "$0" 2>/dev/null)" || REAL="$0"
|
|
26
36
|
PACKAGE_DIR="$(dirname "$REAL")/.."
|
|
27
37
|
ENTRY="$PACKAGE_DIR/src/cli/index.ts"
|
|
28
38
|
|
|
29
39
|
if [ ! -f "$ENTRY" ]; then
|
|
30
|
-
# Fallback: try npm global root
|
|
31
40
|
ENTRY="$(npm root -g 2>/dev/null)/niahere/src/cli/index.ts"
|
|
32
41
|
fi
|
|
33
42
|
|
|
@@ -36,4 +45,4 @@ if [ ! -f "$ENTRY" ]; then
|
|
|
36
45
|
exit 1
|
|
37
46
|
fi
|
|
38
47
|
|
|
39
|
-
exec
|
|
48
|
+
exec "$BUN_CMD" "$ENTRY" "$@"
|
package/package.json
CHANGED