From 32ec2be7251ce1336282969bb12bf0f2c0c964a1 Mon Sep 17 00:00:00 2001 From: Snigdhajyoti Ghosh Date: Thu, 16 Feb 2023 13:45:16 +0530 Subject: [PATCH] Handle shasum not existing on windows platform --- global_install_scripts/install.bash | 7 ++++++- global_install_scripts/update_talisman.bash | 7 ++++++- install.sh | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/global_install_scripts/install.bash b/global_install_scripts/install.bash index a52f5fd4..15160f3e 100755 --- a/global_install_scripts/install.bash +++ b/global_install_scripts/install.bash @@ -144,7 +144,12 @@ function run() { pushd ${TEMP_DIR} >/dev/null 2>&1 grep ${TALISMAN_BINARY_NAME} ${CHECKSUM_FILE_NAME} >${CHECKSUM_FILE_NAME}.single - shasum -a 256 -c ${CHECKSUM_FILE_NAME}.single + + if ! command -v shasum &> /dev/null; then + sha256sum -c ${CHECKSUM_FILE_NAME}.single + else + shasum -a 256 -c ${CHECKSUM_FILE_NAME}.single + fi popd >/dev/null 2>&1 echo_debug "Checksum verification successfull!" echo diff --git a/global_install_scripts/update_talisman.bash b/global_install_scripts/update_talisman.bash index eaf9103c..b24de8e5 100755 --- a/global_install_scripts/update_talisman.bash +++ b/global_install_scripts/update_talisman.bash @@ -122,7 +122,12 @@ function run() { pushd ${TEMP_DIR} >/dev/null 2>&1 grep ${TALISMAN_BINARY_NAME} ${CHECKSUM_FILE_NAME} >${CHECKSUM_FILE_NAME}.single - shasum -a 256 -c ${CHECKSUM_FILE_NAME}.single + + if ! command -v shasum &> /dev/null; then + sha256sum -c ${CHECKSUM_FILE_NAME}.single + else + shasum -a 256 -c ${CHECKSUM_FILE_NAME}.single + fi popd >/dev/null 2>&1 echo_debug "Checksum verification successful!" echo diff --git a/install.sh b/install.sh index 24f72069..89b30327 100755 --- a/install.sh +++ b/install.sh @@ -134,7 +134,12 @@ run() { pushd ${TEMP_DIR} >/dev/null 2>&1 grep ${TALISMAN_BINARY_NAME} ${CHECKSUM_FILE_NAME} >${CHECKSUM_FILE_NAME}.single - shasum -a 256 -c ${CHECKSUM_FILE_NAME}.single + + if ! command -v shasum &> /dev/null; then + sha256sum -c ${CHECKSUM_FILE_NAME}.single + else + shasum -a 256 -c ${CHECKSUM_FILE_NAME}.single + fi popd >/dev/null 2>&1 echo_debug "Checksum verification successful!" echo