mirror of
https://codeberg.org/FabricSoul/dwl.git
synced 2025-08-03 20:10:23 -04:00
add flag to print version and exit
This commit is contained in:
parent
07d56c6d7b
commit
5d8084daa7
4 changed files with 20 additions and 2 deletions
13
generate-version.sh
Executable file
13
generate-version.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
if git tag --contains HEAD | grep -q $1; then
|
||||
echo $1
|
||||
else
|
||||
branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
commit="$(git rev-parse --short HEAD)"
|
||||
if [ "${branch}" != "main" ]; then
|
||||
echo $1-$branch-$commit
|
||||
else
|
||||
echo $1-$commit
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue