Skip to content

Commit 75bc8b8

Browse files
committed
fix: update UPDATER_URL
1 parent 45bc969 commit 75bc8b8

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

cmd/updater/update.sh

+14-15
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ function get_updater_url() {
190190
echo "This operation system ${UNAME} is not supported by updater."
191191
exit 1
192192
fi
193-
UPDATER_FILENAME="install_master_${OS}-${ARCH}.tar.gz"
194-
UPDATER_URL="https://github.com/algorand/go-algorand-doc/raw/master/downloads/installers/${OS}_${ARCH}/${UPDATER_FILENAME}"
193+
UPDATER_FILENAME="install_stable_${OS}-${ARCH}_3.6.2.tar.gz"
194+
UPDATER_URL="https://github.com/algorand/go-algorand/releases/download/v3.6.2-stable/install_stable_${OS}-${ARCH}_3.6.2.tar.gz"
195195
}
196196
197197
# check to see if the binary updater exists. if not, it will automatically the correct updater binary for the current platform
@@ -214,35 +214,34 @@ function check_for_updater() {
214214
exit 1
215215
fi
216216
217-
# intitialize temporary directory for updater
218-
local updater_tempdir="" \
219-
updater_archive="${updater_tempdir}/${UPDATER_FILENAME}"
217+
# create temporary directory for updater archive
218+
local UPDATER_TEMPDIR=""
219+
UPDATER_TEMPDIR="$(mktemp -d 2>/dev/null || mktemp -d -t "tmp")"
220220
221-
# create temporary directory for updater archive
222-
updater_tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t "tmp")
221+
local UPDATER_ARCHIVE="${UPDATER_TEMPDIR}/${UPDATER_FILENAME}"
223222
224-
CURL_OUT=$(curl -sSL ${UPDATER_URL} -o "$updater_archive")
223+
CURL_OUT=$(curl -sSL ${UPDATER_URL} -o "$UPDATER_ARCHIVE")
225224
if [ "$?" != "0" ]; then
226225
echo "failed to download updater binary from ${UPDATER_URL} using curl."
227226
echo "${CURL_OUT}"
228227
exit 1
229228
fi
230229
231-
if [ ! -f "${updater_archive}" ]; then
232-
echo "downloaded file ${updater_archive} is missing."
230+
if [ ! -f "${UPDATER_ARCHIVE}" ]; then
231+
echo "downloaded file ${UPDATER_ARCHIVE} is missing."
233232
exit
234233
fi
235234
236-
# extract and install updater
237-
tar -zxf "$updater_archive" -C "$updater_tempdir" updater
238-
mv "${updater_tempdir}/updater" "${SCRIPTPATH}"
235+
# extract and install updater
236+
tar -zxf "$UPDATER_ARCHIVE" -C "$UPDATER_TEMPDIR" updater
237+
mv "${UPDATER_TEMPDIR}/updater" "${SCRIPTPATH}"
239238
if [ "$?" != "0" ]; then
240-
echo "failed to extract updater binary from ${updater_archive}"
239+
echo "failed to extract updater binary from ${UPDATER_ARCHIVE}"
241240
exit 1
242241
fi
243242
244243
# clean up temp directory
245-
rm -rf "$updater_tempdir"
244+
rm -rf "$UPDATER_TEMPDIR"
246245
echo "updater binary was installed at ${SCRIPTPATH}/updater"
247246
}
248247

0 commit comments

Comments
 (0)