summaryrefslogtreecommitdiff
path: root/irssi-version.sh
diff options
context:
space:
mode:
authorAilin Nemui <ailin@linux.localdomain>2015-07-09 14:20:30 +0200
committerAilin Nemui <ailin@linux.localdomain>2015-07-09 14:20:30 +0200
commita393c675400a41f7cc3df988c25242857da678a4 (patch)
treecde73e36ba77d02cdd1d761c20fbfae09d845270 /irssi-version.sh
parent6fcafc599350737d0d14f3c863af594efc391124 (diff)
downloadirssi-a393c675400a41f7cc3df988c25242857da678a4.zip
Introduce check for git commands in autogen
This avoids a misleading compile error when users try to `make` an incomplete (or non-git) check-out.
Diffstat (limited to 'irssi-version.sh')
-rwxr-xr-xirssi-version.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/irssi-version.sh b/irssi-version.sh
index 7588182d..1e9eae34 100755
--- a/irssi-version.sh
+++ b/irssi-version.sh
@@ -5,6 +5,12 @@ DATE=`GIT_DIR=$1/.git git log -1 --pretty=format:%ai HEAD`
VERSION_DATE=`echo $DATE | cut -f 1 -d ' ' | tr -d -`
VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F: '{printf "%d", $1$2}'`
+if test -z "$VERSION_DATE"; then
+ exec>&2
+ echo "**Error**: `basename "$0"` must be run in a git clone, cannot proceed."
+ exit 1
+fi
+
echo "#define IRSSI_VERSION_DATE $VERSION_DATE"
echo "#define IRSSI_VERSION_TIME $VERSION_TIME"