1
0
mirror of https://github.com/rancher/cli.git synced 2026-02-05 09:48:36 +01:00
Files
cli/scripts/version

15 lines
308 B
Plaintext
Raw Permalink Normal View History

2016-05-26 20:00:15 -07:00
#!/bin/bash
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi
COMMIT=$(git rev-parse --short HEAD)
2018-09-11 11:15:13 -07:00
GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)}
2016-05-26 20:00:15 -07:00
if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VERSION=$GIT_TAG
else
VERSION="${COMMIT}${DIRTY}"
fi