diff --git a/genver.sh b/genver.sh index c6a6fae..e164466 100755 --- a/genver.sh +++ b/genver.sh @@ -10,12 +10,12 @@ fi if [ ! -d .git ] || ! `(git status | grep -q "On branch") 2> /dev/null`; then # If we don't have git, we can't work out what # version this is. It must have been downloaded as a - # zip file. - + # zip file. + # If downloaded from the release page, the directory # has the version number. release=`pwd | sed s/.*sslh-// | grep "[[:digit:]]"` - + if [ "x$release" = "x" ]; then # If downloaded from the head, GitHub creates the # zip file with all files dated from the last @@ -28,7 +28,7 @@ fi if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then # generate the version info based on the tag release=`(git describe --tags || git --describe || git describe --all --long) \ - 2>/dev/null | tr -d '\n'` + 2>/dev/null | tr -s '/' '-' | tr -d '\n'` # Are there uncommitted changes? git update-index --refresh --unmerged > /dev/null