Skip to content

Commit

Permalink
Fix arm install script (#159)
Browse files Browse the repository at this point in the history
* fix: aarch64 linux install

* fix: install from binary directory path
  • Loading branch information
nimish-ks authored Aug 27, 2024
1 parent 4a42f4c commit 6a6434b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,34 +85,34 @@ install_from_binary() {
x86_64)
ZIP_URL="$BASE_URL/v$VERSION/phase_cli_linux_amd64_$VERSION.zip"
CHECKSUM_URL="$BASE_URL/v$VERSION/phase_cli_linux_amd64_$VERSION.sha256"
EXTRACT_DIR="Linux-binary/phase"
;;
aarch64)
ZIP_URL="$BASE_URL/v$VERSION/phase_cli_linux_arm64_$VERSION.zip"
CHECKSUM_URL="$BASE_URL/v$VERSION/phase_cli_linux_arm64_$VERSION.sha256"
EXTRACT_DIR="phase_cli_release_$VERSION/Linux-binary/phase"
;;
*)
echo "Unsupported architecture: $ARCH. This script supports x86_64 and arm64."
exit 1
;;
esac

wget_download $ZIP_URL $TMPDIR/phase_cli_${ARCH}_$VERSION.zip

unzip $TMPDIR/phase_cli_${ARCH}_$VERSION.zip -d $TMPDIR

BINARY_PATH="$TMPDIR/Linux-binary/phase/phase"
INTERNAL_DIR_PATH="$TMPDIR/Linux-binary/phase/_internal"

wget_download "$ZIP_URL" "$TMPDIR/phase_cli_${ARCH}_$VERSION.zip"
unzip "$TMPDIR/phase_cli_${ARCH}_$VERSION.zip" -d "$TMPDIR"

BINARY_PATH="$TMPDIR/$EXTRACT_DIR/phase"
INTERNAL_DIR_PATH="$TMPDIR/$EXTRACT_DIR/_internal"

verify_checksum "$BINARY_PATH" "$CHECKSUM_URL"

chmod +x $BINARY_PATH

chmod +x "$BINARY_PATH"

if ! has_sudo_access; then
echo "Moving items to /usr/local/bin. Please enter your sudo password or run as root."
fi

sudo mv $BINARY_PATH /usr/local/bin/phase
sudo mv $INTERNAL_DIR_PATH /usr/local/bin/_internal
sudo mv "$BINARY_PATH" /usr/local/bin/phase
sudo mv "$INTERNAL_DIR_PATH" /usr/local/bin/_internal
}

install_package() {
Expand Down

0 comments on commit 6a6434b

Please sign in to comment.