diff --git a/utils.sh b/utils.sh index 2084e99..d5f1c43 100755 --- a/utils.sh +++ b/utils.sh @@ -1,6 +1,6 @@ #!/bin/bash -#All common functions can be added to this file +# All common functions can be added to this file exists() { type -t "$1" > /dev/null 2>&1; } diff --git a/version.sh b/version.sh index c6feaef..59ca17d 100755 --- a/version.sh +++ b/version.sh @@ -1,18 +1,20 @@ #!/bin/bash -set -e - if [[ -z "${BUILD_SOURCEVERSION}" ]]; then - npm install -g checksum - vscodium_hash=$( git rev-parse HEAD ) cd vscode vscode_hash=$( git rev-parse HEAD ) cd .. - export BUILD_SOURCEVERSION=$( echo "${vscodium_hash}:${vscode_hash}" | checksum ) + if type -t "sha1sum" > /dev/null 2>&1; then + export BUILD_SOURCEVERSION=$( echo "${vscodium_hash}:${vscode_hash}" | sha1sum | cut -d' ' -f1 ) + else + npm install -g checksum + + export BUILD_SOURCEVERSION=$( echo "${vscodium_hash}:${vscode_hash}" | checksum ) + fi echo "Build version: ${BUILD_SOURCEVERSION}"