1#!/bin/bash
2#
3# Write the Git commit SHA to an include file.
4# This should be run before compiling code on Linux or Macintosh.
5#
6revision_filename=src/common/pa_gitrevision.h
7
8# Run git first to make sure it is installed before corrupting the
9# include file.
10git rev-parse HEAD
11
12# Update the include file with the current Git revision.
13echo -n "#define PA_GIT_REVISION " > ${revision_filename}
14git rev-parse HEAD >> ${revision_filename}
15
16echo ${revision_filename} now contains
17cat ${revision_filename}
18