@gnar-engine/cli 1.0.2 → 1.0.3
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/install.sh +32 -0
- package/package.json +1 -1
package/install.sh
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
PACKAGE_NAME="@gnar-engine/cli"
|
|
5
|
+
TARGET_DIR="$HOME/.gnarengine"
|
|
6
|
+
|
|
7
|
+
echo "Installing $PACKAGE_NAME locally for user $USER..."
|
|
8
|
+
|
|
9
|
+
# Create the global config directory
|
|
10
|
+
mkdir -p "$TARGET_DIR"
|
|
11
|
+
cd "$TARGET_DIR"
|
|
12
|
+
|
|
13
|
+
# Install the package
|
|
14
|
+
npm install "$PACKAGE_NAME" --no-audit --no-fund
|
|
15
|
+
|
|
16
|
+
# Get the local bin path
|
|
17
|
+
BIN_PATH="$TARGET_DIR/node_modules/.bin"
|
|
18
|
+
|
|
19
|
+
# Add to shell PATH if not already present
|
|
20
|
+
if ! grep -q "$BIN_PATH" "$HOME/.bashrc" 2>/dev/null; then
|
|
21
|
+
echo "export PATH=\"$BIN_PATH:\$PATH\"" >> "$HOME/.bashrc"
|
|
22
|
+
echo "Added $BIN_PATH to PATH in ~/.bashrc"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# For zsh users (macOS default)
|
|
26
|
+
if [ -f "$HOME/.zshrc" ] && ! grep -q "$BIN_PATH" "$HOME/.zshrc"; then
|
|
27
|
+
echo "export PATH=\"$BIN_PATH:\$PATH\"" >> "$HOME/.zshrc"
|
|
28
|
+
echo "Added $BIN_PATH to PATH in ~/.zshrc"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
echo "G n a r E n g i n e - Installation complete! Please restart your terminal and run 'gnar --help' to verify."
|
|
32
|
+
|