Skip to content

Commit

Permalink
remove comments from install
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettMayson committed Oct 18, 2024
1 parent 7a8b578 commit e2c912c
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions book/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

set -e

# Define the GitHub repo and release
GITHUB_API="https://api.github.com/repos/brettmayson/HEMTT/releases/latest"

# Get the latest release info
RELEASE_INFO=$(curl -s "$GITHUB_API")
DOWNLOAD_URL=""

# Detect OS and architecture
case "$(uname -s)" in
Linux*)
ARCH="$(uname -m)"
Expand Down Expand Up @@ -37,7 +34,6 @@ case "$(uname -s)" in
;;
esac

# Download the binary
if [ -z "$DOWNLOAD_URL" ]; then
echo "Could not find a suitable binary for your system."
exit 1
Expand All @@ -47,7 +43,6 @@ echo "Downloading from $DOWNLOAD_URL..."
mkdir -p /tmp/hemtt-installer
curl -L -o /tmp/hemtt-installer/hemtt "$DOWNLOAD_URL"

# Make it executable
chmod +x /tmp/hemtt-installer/hemtt

binaryLocation="$HOME/.local/bin"
Expand All @@ -57,12 +52,9 @@ fi
mkdir -p "$binaryLocation"

if ! echo "$PATH" | grep -q "$binaryLocation"; then
# Array of common shell configuration files
config_files=("$HOME/.bashrc" "$HOME/.bash_profile" "$HOME/.zshrc" "$HOME/.profile")
for config in "${config_files[@]}"; do
# Check if the file exists
if [ -f "$config" ]; then
# Check if binaryLocation is already in the file
if ! grep -q -s "export PATH=$binaryLocation:\$PATH" "$config"; then
echo "Appending $binaryLocation to $config"
echo "" >>"$config"
Expand All @@ -71,11 +63,9 @@ if ! echo "$PATH" | grep -q "$binaryLocation"; then
fi
fi
done
# add to the current session
export PATH=$binaryLocation:$PATH
fi

# Move the binary to the correct location, check for sudo
if [ -w "$binaryLocation" ]; then
mv /tmp/hemtt-installer/hemtt "$binaryLocation"
else
Expand Down

0 comments on commit e2c912c

Please sign in to comment.