Skip to content

Commit 23928f0

Browse files
committed
feat(install): move install resource location to s3
1 parent 34c0bf3 commit 23928f0

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

get-armory-cli

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
#! /usr/bin/env bash
22

3-
calculate_time_to_retry_in_minutes() {
4-
time_to_retry=$1
5-
current_date=$(date +%s)
6-
retry_in_date=$(date -r "$time_to_retry" +%s)
7-
echo $(( (retry_in_date - current_date) / 60))
8-
}
9-
103
throw_error_message() {
114
echo "#############################################################################################################"
125
echo "# We're so sorry, we couldn't install Armory Version Manager (avm) or the armory CLI."
@@ -79,15 +72,9 @@ if ! command -v curl > /dev/null; then
7972
exit 1
8073
fi
8174

82-
status_code=$(curl --write-out %{http_code} --silent --output /dev/null https://api.github.com/repos/armory/avm/releases/latest)
83-
if [[ "$status_code" -eq 403 ]] ; then
84-
time_to_retry=$(curl -s -I -L https://api.github.com/repos/armory/avm/releases/latest | grep "X-RateLimit-Reset:" | cut -d : -f 2 | tr -d $'\r' | bc | xargs echo -n)
85-
throw_error_message "GitHub API rate limit exceeded - Check out GitHub documentation for more details, you can re-run this script in $(calculate_time_to_retry_in_minutes "$time_to_retry") minutes."
86-
fi
87-
8875
echo "Detected ${OS}-${ARCH}, preparing to install Armory Version Manager and Armory CLI"
8976

90-
DOWNLOAD_URL=$(curl -L -s https://api.github.com/repos/armory/avm/releases/latest | grep "browser_download_url.*avm-${OS}-${ARCH}" | cut -d : -f 2,3 | tr -d \" | xargs echo -n)
77+
DOWNLOAD_URL=https://armory-cli-releases.s3.amazonaws.com/avm/v1.2.0/avm-${OS}-${ARCH}
9178
DEST_DIR="${HOME}/.avm/bin"
9279
mkdir -p "$DEST_DIR"
9380
DEST="${DEST_DIR}/avm"

0 commit comments

Comments
 (0)