mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Don't use /bin/bash ! Many systems do not have bash there (they might have it at /usr/local/bin/bash, for example). Don't specify bash unless you specifically need bash features -- many systems do not have bash installed by default.
22 lines
416 B
Bash
22 lines
416 B
Bash
#!/bin/sh
|
|
|
|
#
|
|
# 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
|