view SCRIPTS/include.sh @ 120:4729c8589274 emscripten-piper

Add piper builds
author Chris Cannam
date Fri, 11 Nov 2016 15:49:32 +0000
parents b107ed308636
children
line wrap: on
line source
#!/bin/bash

vcs_id() {
    dir="$1"
    ( cd "$dir" ;
      if [ -d .hg ]; then
	  tag=$(hg id -t -r 'parents(.)') # tag is always followed by tag-commit
	  if [ "$tag" != "" ]; then
	      echo "${tag#$dir-}" # strip dir- prefix from tag if present
	  else 
	      hg id | awk '{ print $1; }'
	  fi
      elif [ -d .git ]; then
	  git rev-parse --short HEAD
      elif [ -d .svn ]; then
	  svn info | grep ^Revision | awk '{ print $2; }'
      else
	  echo "unknown"
      fi
    )
}