vscodium/version.sh

21 lines
545 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2022-08-16 14:51:45 +03:00
if [[ -z "${BUILD_SOURCEVERSION}" ]]; then
if type -t "sha1sum" &> /dev/null; then
BUILD_SOURCEVERSION=$( echo "${RELEASE_VERSION/-*/}" | sha1sum | cut -d' ' -f1 )
else
npm install -g checksum
BUILD_SOURCEVERSION=$( echo "${RELEASE_VERSION/-*/}" | checksum )
fi
2022-08-16 14:51:45 +03:00
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\""
2022-08-16 14:51:45 +03:00
# for GH actions
if [[ "${GITHUB_ENV}" ]]; then
echo "BUILD_SOURCEVERSION=${BUILD_SOURCEVERSION}" >> "${GITHUB_ENV}"
2022-08-16 14:51:45 +03:00
fi
fi
export BUILD_SOURCEVERSION