Skip to content

Commit

Permalink
Handle binary incompatibility during upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dcRUSTy authored and svishwanath-tw committed Nov 1, 2022
1 parent 8f60fef commit aafbc40
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions global_install_scripts/update_talisman.bash
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ function run() {
verify_checksum ${TALISMAN_BINARY_NAME}
}

function verify_binary_is_working() {
chmod +x ${TEMP_DIR}/${TALISMAN_BINARY_NAME}
if ! ${TEMP_DIR}/${TALISMAN_BINARY_NAME} --version; then
echo_error "Binary is not working, SKIPPING UPGRADE, Please open issue on github with your OS name and version"
exit 0
fi
}

function download_talisman_hook_script() {
echo_debug "Running download_talisman_hook_script"
curl --silent https://raw.githubusercontent.com/${INSTALL_ORG_REPO}/master/global_install_scripts/talisman_hook_script.bash >${TEMP_DIR}/talisman_hook_script
Expand Down Expand Up @@ -174,6 +182,7 @@ function run() {
set_talisman_binary_name
echo "Downloading latest talisman binary..."
download_talisman_binary
verify_binary_is_working
setup_talisman
if [ -z "$UPDATE_TYPE" ]; then
echo "Downloading latest talisman hook script..."
Expand Down

0 comments on commit aafbc40

Please sign in to comment.