Skip to content

Commit

Permalink
Initial work on adding the install.sh script
Browse files Browse the repository at this point in the history
This will be used by the users of Prompt-Ops to download the pops binary

Signed-off-by: ytimocin <ytimocin@microsoft.com>
  • Loading branch information
ytimocin committed Jan 4, 2025
1 parent 99e7952 commit a587a3c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -e

# Get the latest release version if not provided
VERSION=${1:-$(curl -s https://api.github.com/repos/prompt-ops/pops/releases/latest | grep tag_name | cut -d '"' -f 4)}

# Detect OS and ARCH
OS=$(uname | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

if [[ "$ARCH" == "x86_64" ]]; then
ARCH="amd64"
elif [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then
ARCH="arm64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi

# Construct download URL
URL="https://github.com/prompt-ops/pops/releases/download/$VERSION/pops-${OS}-${ARCH}"

echo "Downloading pops $VERSION from $URL..."
curl -Lo pops "$URL"
chmod +x pops

# Move to /usr/local/bin
echo "Installing pops to /usr/local/bin..."
sudo mv pops /usr/local/bin/

echo "pops $VERSION installed successfully!"

0 comments on commit a587a3c

Please sign in to comment.