From b3a3080b4b3565b3f59f8627212e59960abeeb87 Mon Sep 17 00:00:00 2001 From: Richard Wackerbarth Date: Wed, 3 Jun 2015 22:55:11 -0500 Subject: [PATCH] Suppress error when on detached head --- LinuxAddons/bin/generate_version_header_for_marlin | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/LinuxAddons/bin/generate_version_header_for_marlin b/LinuxAddons/bin/generate_version_header_for_marlin index 1a864f5fb3..0fa120bde4 100755 --- a/LinuxAddons/bin/generate_version_header_for_marlin +++ b/LinuxAddons/bin/generate_version_header_for_marlin @@ -13,8 +13,8 @@ echo "#define BUILD_UNIX_DATETIME" `date +%s` >>"$OUTFILE" echo "#define STRING_DISTRIBUTION_DATE" `date '+"%Y-%m-%d %H:%M"'` >>"$OUTFILE" ( set +e cd "$DIR" - BRANCH=`git symbolic-ref --short HEAD` - if [ "x$BRANCH" == "xHEAD" ] ; then + BRANCH=`git symbolic-ref -q --short HEAD` + if [ "x$BRANCH" == "x" ] ; then BRANCH="" elif [ "x$BRANCH" == "xDevelopment" ] ; then BRANCH=" dev" @@ -31,5 +31,4 @@ echo "#define STRING_DISTRIBUTION_DATE" `date '+"%Y-%m-%d %H:%M"'` >>"$OUTFILE" echo "// Deprecated URL definition" >>"$OUTFILE" echo "#define FIRMWARE_URL \""$URL"\"" >>"$OUTFILE" fi - )