-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·51 lines (41 loc) · 1.06 KB
/
install.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
set -e
# Run the build script
./build.sh
# Get version from package.json
VERSION=$(cat package.json | jq -r '.version')
# Detect OS and Architecture
OS="$(uname -s)"
ARCH="$(uname -m)"
BINARY_NAME=""
if [ "$OS" == "Darwin" ]; then
if [ "$ARCH" == "arm64" ]; then
BINARY_NAME="justinstall-${VERSION}-darwin-arm64"
else
BINARY_NAME="justinstall-${VERSION}-darwin-x64"
fi
elif [ "$OS" == "Linux" ]; then
if [ "$ARCH" == "aarch64" ]; then
BINARY_NAME="justinstall-${VERSION}-linux-arm64"
else
BINARY_NAME="justinstall-${VERSION}-linux-x64"
fi
else
echo "Unsupported OS: $OS"
exit 1
fi
SOURCE="build/$BINARY_NAME"
DEST_DIR="$HOME/.local/bin"
DEST="$DEST_DIR/justinstall"
if [ ! -f "$SOURCE" ]; then
echo "Error: Binary $SOURCE not found!"
exit 1
fi
# Ensure destination directory exists
mkdir -p "$DEST_DIR"
# Install
echo "Installing $SOURCE to $DEST..."
cp "$SOURCE" "$DEST"
chmod +x "$DEST"
echo "Successfully installed justinstall to $DEST"
echo "Make sure $DEST_DIR is in your PATH."