annotate SCRIPTS/include.sh @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents b107ed308636
children
rev   line source
Chris@75 1 #!/bin/bash
Chris@75 2
Chris@75 3 vcs_id() {
Chris@75 4 dir="$1"
Chris@75 5 ( cd "$dir" ;
Chris@113 6 if [ -d .hg ]; then
Chris@113 7 tag=$(hg id -t -r 'parents(.)') # tag is always followed by tag-commit
Chris@113 8 if [ "$tag" != "" ]; then
Chris@113 9 echo "${tag#$dir-}" # strip dir- prefix from tag if present
Chris@113 10 else
Chris@113 11 hg id | awk '{ print $1; }'
Chris@113 12 fi
Chris@113 13 elif [ -d .git ]; then
Chris@113 14 git rev-parse --short HEAD
Chris@113 15 elif [ -d .svn ]; then
Chris@113 16 svn info | grep ^Revision | awk '{ print $2; }'
Chris@113 17 else
Chris@113 18 echo "unknown"
Chris@113 19 fi
Chris@75 20 )
Chris@75 21 }
Chris@75 22