github.com/immesys/bw2bc@v1.1.0/build/ldflags.sh (about) 1 #!/bin/sh 2 3 set -e 4 5 if [ ! -f "build/env.sh" ]; then 6 echo "$0 must be run from the root of the repository." 7 exit 2 8 fi 9 10 # set gitCommit when running from a Git checkout. 11 if [ -f ".git/HEAD" ]; then 12 echo "-ldflags '-X main.gitCommit $(git rev-parse HEAD)'" 13 fi