Skip to content

Commit

Permalink
chore: add sudo to install script
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskukk committed Nov 3, 2024
1 parent 32f2acf commit 9c7816f
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@
REPO="tomaskukk/lounasta"
VERSION="0.0.1" # Replace with the latest release version

# Detect the platform
case "$(uname -s)" in
Linux*) OS="linux";;
Darwin*) OS="darwin";;
CYGWIN*|MINGW*|MSYS_NT*) OS="windows";;
*) echo "Unsupported OS"; exit 1;;
esac
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

ARCH="$(uname -m)"
case "$ARCH" in
x86_64) ARCH="amd64";;
arm64) ARCH="arm64";;
*) echo "Unsupported architecture"; exit 1;;
*) echo "Unsupported architecture: $ARCH"; exit 1;;
esac

# Download the binary

FILE="lounasta-$OS-$ARCH"
URL="https://github.com/$REPO/releases/download/$VERSION/$FILE.zip"

# Download and install
echo "Downloading $FILE from $URL..."
curl -L -o "$FILE.zip" "$URL" || { echo "Download failed"; exit 1; }

# Extract and install
unzip "$FILE.zip"
echo "Extracting $FILE.zip..."
unzip -o "$FILE.zip" || { echo "Extraction failed"; exit 1; }
chmod +x "$FILE"
mv "$FILE" /usr/local/bin/lounasta || { echo "Permission denied"; exit 1; }

echo "Lounasta installed successfully! Run it with 'lounasta'."
echo "Installing $FILE to /usr/local/bin..."
sudo mv "$FILE" /usr/local/bin/lounasta || { echo "Installation failed"; exit 1; }

echo "Cleaning up..."
rm "$FILE.zip"

echo "Lounasta installed successfully! You can now run it with 'lounasta'."

0 comments on commit 9c7816f

Please sign in to comment.