Browse code

Windows: Only set VERSION_QUAD if unset

When trying to build with some pretty typical version strings this was
causing failures trying to generate the windows resource file.

The resource file is already gated by an `ifdef` for this var, so
instead of blindly setting based on "VERSION", which can contain some
characters which are incompatible (e.g. 1.2.3.rc.0 will fail due to the
".rc").

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2019/11/05 10:16:06
Showing 1 changed files
... ...
@@ -57,7 +57,9 @@ if [ "$(go env GOOS)" = "windows" ]; then
57 57
 	fi
58 58
 
59 59
 	# Generate a Windows file version of the form major,minor,patch,build (with any part optional)
60
-	VERSION_QUAD=$(echo -n $VERSION | sed -re 's/^([0-9.]*).*$/\1/' | tr . ,)
60
+	if [ ! -v VERSION_QUAD ]; then
61
+		VERSION_QUAD=$(echo -n $VERSION | sed -re 's/^([0-9.]*).*$/\1/' | tr . ,)
62
+	fi
61 63
 
62 64
 	# Pass version and commit information into the resource compiler
63 65
 	defs=