Windows build fix for projects not defining WebKitLibrariesDir.
[WebKit-https.git] / WebKitLibraries / win / tools / scripts / auto-version.sh
index cbdc1af..6d629f9 100755 (executable)
@@ -32,14 +32,17 @@ chomp()
     eval $1=\$value;
 }
 
-FALLBACK_VERSION_PATH=`cygpath -u "$WEBKITLIBRARIESDIR\\tools\\scripts\\VERSION"`
+if [ "$WEBKITLIBRARIESDIR" != "" ]; then
+    FALLBACK_VERSION_PATH=`cygpath -u "$WEBKITLIBRARIESDIR\\tools\\scripts\\VERSION"`
+    FALLBACK_VERSION=$(cat "$FALLBACK_VERSION_PATH");
+fi
+
 OUTPUT_FILE=$(cygpath -u "$1")/include/autoversion.h
 mkdir -p "$(dirname "$OUTPUT_FILE")"
 
 # Take the initial version number from RC_PROJECTSOURCEVERSION if it
 # exists, otherwise fall back to the version number stored in the source.
 ENVIRONMENT_VERSION="$RC_PROJECTSOURCEVERSION";
-FALLBACK_VERSION=$(cat "$FALLBACK_VERSION_PATH");
 PROPOSED_VERSION=${ENVIRONMENT_VERSION:-$FALLBACK_VERSION}
 chomp PROPOSED_VERSION