Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: install gookme in HOME local bin #8

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BINARY_NAME="gookme"

# Determine the OS and architecture
OS=$(uname | tr '[:upper:]' '[:lower:]')
# OS is darwin on MacOS and default to linux for all other OSes
# OS is darwin on MacOS and defaults to linux for all other OSes
if [ "$OS" == "darwin" ]; then
echo "Downloading Gookme for MacOS..."
OS="darwin"
Expand Down Expand Up @@ -42,8 +42,16 @@ curl -L -o "$BINARY_NAME" "$URL"
# Make the binary executable
chmod +x "$BINARY_NAME"

# Move the binary to a directory in the PATH
mv "$BINARY_NAME" "/usr/local/bin/$BINARY_NAME"
# Create the .local/bin directory if it doesn't exist
LOCAL_BIN="$HOME/.local/bin"
if [ ! -d "$LOCAL_BIN" ]; then
echo "Creating $LOCAL_BIN directory..."
mkdir -p "$LOCAL_BIN"
fi

# Move the binary to the .local/bin directory
mv "$BINARY_NAME" "$LOCAL_BIN/$BINARY_NAME"

gookme --version
# Verify the installation
"$LOCAL_BIN/$BINARY_NAME" --version
echo "Successfully installed Gookme."