Browse Source

Suppress error when on detached head

Richard Wackerbarth 9 years ago
parent
commit
b3a3080b4b
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      LinuxAddons/bin/generate_version_header_for_marlin

+ 2
- 3
LinuxAddons/bin/generate_version_header_for_marlin View File

@@ -13,8 +13,8 @@ echo "#define BUILD_UNIX_DATETIME" `date +%s` >>"$OUTFILE"
13 13
 echo "#define STRING_DISTRIBUTION_DATE" `date '+"%Y-%m-%d %H:%M"'` >>"$OUTFILE"
14 14
 ( set +e
15 15
   cd "$DIR"
16
-  BRANCH=`git symbolic-ref --short HEAD`
17
-  if [ "x$BRANCH" == "xHEAD" ] ; then
16
+  BRANCH=`git symbolic-ref -q --short HEAD`
17
+  if [ "x$BRANCH" == "x" ] ; then
18 18
     BRANCH=""
19 19
   elif [ "x$BRANCH" == "xDevelopment" ] ; then
20 20
     BRANCH=" dev"
@@ -31,5 +31,4 @@ echo "#define STRING_DISTRIBUTION_DATE" `date '+"%Y-%m-%d %H:%M"'` >>"$OUTFILE"
31 31
     echo "// Deprecated URL definition" >>"$OUTFILE"
32 32
     echo "#define FIRMWARE_URL  \""$URL"\"" >>"$OUTFILE"
33 33
   fi
34
-  
35 34
 )

Loading…
Cancel
Save