-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
53 lines (41 loc) · 1.02 KB
/
install.sh
File metadata and controls
53 lines (41 loc) · 1.02 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
52
53
#!/bin/bash
OS=$(uname -s)
# Detect OS
if [ "$OS" != "Linux" ]; then
echo "Unsupported OS: $OS. Only Linux is supported."
exit 1
fi
# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64)
ARCH="amd64"
;;
aarch64 | arm64)
ARCH="arm64"
;;
*)
echo "❌ Unsupported architecture: $ARCH"
exit 1
;;
esac
# Construct binary name
BINARY="stackjet-linux-${ARCH}"
echo "Downloading stackjet for $OS..."
curl -L -o stackjet "https://github.com/satnamSandhu2001/StackJet/releases/latest/download/$BINARY"
if [ $? -ne 0 ]; then
echo "Error: Failed to download stackjet. Please check your internet connection or the GitHub repository."
exit 1
fi
echo "Making stackjet executable..."
chmod +x stackjet
echo "Moving stackjet to /usr/local/bin/ (requires sudo)..."
sudo mv stackjet /usr/local/bin/
if [ $? -ne 0 ]; then
echo "Error: Failed to move stackjet. Do you have sudo permissions?"
exit 1
fi
echo "stackjet installed successfully!"
echo "Initializing stackjet..."
stackjet init
exit 0