Skip to content

Commit

Permalink
fix: install script
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleTryon committed May 26, 2023
1 parent ee7d43d commit 939e50f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
VERSION=$(curl -s https://api.github.com/repos/TechSquidTV/uhs-cli/releases/latest | grep tag_name | cut -d '"' -f 4)

# The operating system and architecture
OS=$(uname | tr '[:upper:]' '[:lower:]')
OS=$(uname)
ARCH=$(uname -m)

# Check if the architecture is x86
Expand All @@ -13,18 +13,22 @@ if [ "$ARCH" = "x86_64" ]; then
fi

# The URL of the release
URL="https://github.com/TechSquidTV/uhs-cli/releases/download/${VERSION}/uhs-cli_${VERSION}_${OS}_${ARCH}.tar.gz"
URL="https://github.com/TechSquidTV/uhs-cli/releases/download/${VERSION}/uhs-cli_${OS}_${ARCH}.tar.gz"

# Download and extract the binary
wget $URL
tar -xvzf uhs-cli_${VERSION}_${OS}_${ARCH}.tar.gz
mkdir uhs-cli_${OS}_${ARCH}
tar -xvzf uhs-cli_${OS}_${ARCH}.tar.gz -C uhs-cli_${OS}_${ARCH}

# Make the binary executable
chmod +x uhs-cli_${OS}_${ARCH}/uhs-cli

# Move the binary to a location in your PATH
sudo mv uhs-cli_${VERSION}_${OS}_${ARCH}/uhs-cli /usr/local/bin/uhs
mv uhs-cli_${OS}_${ARCH}/uhs-cli ~/.local/bin/uhs

# Clean up the downloaded file and the extracted directory
rm uhs-cli_${VERSION}_${OS}_${ARCH}.tar.gz
rm -rf uhs-cli_${VERSION}_${OS}_${ARCH}
rm uhs-cli_${OS}_${ARCH}.tar.gz
rm -rf uhs-cli_${OS}_${ARCH}

echo "Installed uhs-cli version ${VERSION}"
echo "Run 'uhs --help' to get started"

0 comments on commit 939e50f

Please sign in to comment.