1#!/usr/bin/env sh 2 3# get tag from git 4tag=`git tag --points-at HEAD` 5 6# get git version 7commit=`git rev-parse --short HEAD` 8 9# use tag if available 10if [ -z "$tag" ] 11then 12 version=${commit} 13else 14 version=${tag}-${commit} 15fi 16 17echo "${version}" 18