summaryrefslogtreecommitdiffstatsci
path: root/src/generate_git_info
blob: e0c221cad0c3a9f3d1ba6807284c8b3c3811f6d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

if [ "x$1" = "x" ] || [ "x$2" = "x" ]; then
    echo "Usage: $0 <source-dir> <output-file>"
    exit -1
fi

source_dir=$1
out_file=$2
git_command=$(git rev-parse HEAD)
(cat <<EOF
#include "git_info.h"
const char * git_sha = "$git_command";
EOF
) > $out_file

echo "" >> $out_file