linux_ws2122/git-info.sh
Markus Pesch fed26c8bbd
All checks were successful
continuous-integration/drone Build is passing
Initial Commit
2021-10-13 19:25:16 +02:00

16 lines
429 B
Bash
Executable File

#!/bin/bash
if [ $1 == "date" ]; then
git log -1 --pretty=format:"%ad" --date=short
elif [ $1 == "commit" ]; then
GV=$(git rev-parse --short HEAD)-git
echo ${VERSION:-$GV}
elif [ $1 == "url" ]; then
URL=$(git config --get remote.origin.url | sed -e 's#^git@#https://#' -e 's#systems:#systems/#' -e 's#_#\\_#g' -e 's#.git$##' )
if [ -z "$URL" ]; then
echo "https://git.cryptic.systems"
else
echo $URL
fi
fi