fix: install checksum only when needed (#1213)

This commit is contained in:
Baptiste Augrain 2022-08-21 19:15:37 +02:00 committed by GitHub
parent 7a2a3a7ab0
commit f21c11dde0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/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; } exists() { type -t "$1" > /dev/null 2>&1; }

View File

@ -1,18 +1,20 @@
#!/bin/bash #!/bin/bash
set -e
if [[ -z "${BUILD_SOURCEVERSION}" ]]; then if [[ -z "${BUILD_SOURCEVERSION}" ]]; then
npm install -g checksum
vscodium_hash=$( git rev-parse HEAD ) vscodium_hash=$( git rev-parse HEAD )
cd vscode cd vscode
vscode_hash=$( git rev-parse HEAD ) vscode_hash=$( git rev-parse HEAD )
cd .. cd ..
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 ) export BUILD_SOURCEVERSION=$( echo "${vscodium_hash}:${vscode_hash}" | checksum )
fi
echo "Build version: ${BUILD_SOURCEVERSION}" echo "Build version: ${BUILD_SOURCEVERSION}"