-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
31 lines (25 loc) · 779 Bytes
/
install.sh
File metadata and controls
31 lines (25 loc) · 779 Bytes
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
#!/bin/bash
set -e
REPO="Quackster/KeplerC"
INSTALL_DIR="$HOME/KeplerC"
ASSET="Kepler-linux.zip"
echo "Fetching latest release..."
DOWNLOAD_URL=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" \
| grep -o "\"browser_download_url\": \"[^\"]*$ASSET\"" \
| cut -d'"' -f4)
if [ -z "$DOWNLOAD_URL" ]; then
echo "Failed to find download URL for $ASSET"
exit 1
fi
mkdir -p "$INSTALL_DIR"
echo "Downloading $ASSET..."
curl -fsSL -o "/tmp/$ASSET" "$DOWNLOAD_URL"
echo "Extracting to $INSTALL_DIR..."
unzip -o "/tmp/$ASSET" -d "$INSTALL_DIR"
mv "$INSTALL_DIR"/Kepler/* "$INSTALL_DIR"/
rmdir "$INSTALL_DIR/Kepler"
chmod +x "$INSTALL_DIR/Kepler"
rm "/tmp/$ASSET"
echo ""
echo "Installed to $INSTALL_DIR"
echo "Run it with: cd $INSTALL_DIR && ./Kepler"