Skip to content

Commit

Permalink
Chore: fix install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
currenjin committed Dec 6, 2024
1 parent 8c82856 commit 55312ac
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@ fi
DOWNLOAD_URL="https://github.com/currenjin/wharf/releases/download/${LATEST_VERSION}/${BINARY_NAME}"

INSTALL_DIR="/usr/local/bin"
mkdir -p "$INSTALL_DIR"

echo "♻️ Downloading wharf..."
curl -L "$DOWNLOAD_URL" -o "$INSTALL_DIR/wharf"
chmod +x "$INSTALL_DIR/wharf"
echo "⚙️ Installing wharf..."
echo "📥 Downloading latest version..."

if [[ $EUID -ne 0 ]]; then
echo "🔒 This script needs sudo privileges to install to $INSTALL_DIR"
sudo mkdir -p "$INSTALL_DIR"
sudo curl -L "$DOWNLOAD_URL" -o "$INSTALL_DIR/wharf"
sudo chmod +x "$INSTALL_DIR/wharf"
else
mkdir -p "$INSTALL_DIR"
curl -L "$DOWNLOAD_URL" -o "$INSTALL_DIR/wharf"
chmod +x "$INSTALL_DIR/wharf"
fi

echo "✅ Wharf has been installed to $INSTALL_DIR/wharf"
echo "🎉 You can now use 'wharf' command from anywhere."

0 comments on commit 55312ac

Please sign in to comment.