mirror of
https://github.com/rancher/cli.git
synced 2026-02-05 09:48:36 +01:00
Initial Commit
This commit is contained in:
14
scripts/version
Executable file
14
scripts/version
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
|
||||
DIRTY="-dirty"
|
||||
fi
|
||||
|
||||
COMMIT=$(git rev-parse --short HEAD)
|
||||
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)
|
||||
|
||||
if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
|
||||
VERSION=$GIT_TAG
|
||||
else
|
||||
VERSION="${COMMIT}${DIRTY}"
|
||||
fi
|
||||
Reference in New Issue
Block a user