mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 03:22:08 +00:00
build: figure out git revision and include as part of version string
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
This commit is contained in:
21
scripts/localversion.sh
Normal file
21
scripts/localversion.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#! /bin/bash
|
||||
|
||||
#
|
||||
# Use git to figure out which version we are using.
|
||||
#
|
||||
# Adapted from a script written by Rene Scharfe <rene.scharfe@lsrfire.ath.cx>,
|
||||
# found in the Linux Kernel.
|
||||
#
|
||||
|
||||
set -u
|
||||
|
||||
if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
|
||||
printf '%s%s' -g $head
|
||||
|
||||
git update-index --refresh --unmerged > /dev/null
|
||||
if git diff-index --name-only HEAD | read dummy; then
|
||||
printf '%s' -dirty
|
||||
fi
|
||||
|
||||
exit
|
||||
fi
|
||||
Reference in New Issue
Block a user