diff --git a/scripts/version.sh b/scripts/version.sh index 8736335f2f3bd..841b9627c4e50 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -15,6 +15,12 @@ set -euo pipefail source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" cdroot +# If in Sapling, just print the commit since we don't have tags. +if [ -d ".sl" ]; then + sl log -l 1 | awk '/changeset/ { print substr($2, 0, 16) }' + exit 0 +fi + if [[ "${CODER_FORCE_VERSION:-}" != "" ]]; then echo "$CODER_FORCE_VERSION" exit 0