From 5d20a54713161a6011b1f683842f7bf0c7624225 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 7 Jan 2019 21:27:05 +0000 Subject: [PATCH] CI: Figure out why master is building with the wrong version number --- bin/build-site.sh | 8 ++++++++ bin/get-version-number | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/build-site.sh b/bin/build-site.sh index c0aa3b635..e38344052 100755 --- a/bin/build-site.sh +++ b/bin/build-site.sh @@ -8,24 +8,32 @@ if [ -z "$TW5_BUILD_VERSION" ]; then TW5_BUILD_VERSION=v5.1.19 fi +echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]" + # Default to using tw5.com as the main edition for /index.html if [ -z "$TW5_BUILD_MAIN_EDITION" ]; then TW5_BUILD_MAIN_EDITION=./editions/tw5.com fi +echo "Using TW5_BUILD_MAIN_EDITION as [$TW5_BUILD_MAIN_EDITION]" + # Default to the version of TiddlyWiki installed in this repo if [ -z "$TW5_BUILD_TIDDLYWIKI" ]; then TW5_BUILD_TIDDLYWIKI=./tiddlywiki.js fi +echo "Using TW5_BUILD_TIDDLYWIKI as [$TW5_BUILD_TIDDLYWIKI]" + # Set up the build details if [ -z "$TW5_BUILD_DETAILS" ]; then TW5_BUILD_DETAILS="$(git symbolic-ref --short HEAD)-$(git rev-parse HEAD) from $(git remote get-url origin)" fi +echo "Using TW5_BUILD_DETAILS as [$TW5_BUILD_DETAILS]" + # Set up the build output directory if [ -z "$TW5_BUILD_OUTPUT" ]; then diff --git a/bin/get-version-number b/bin/get-version-number index 34e2940ca..77fe95f0b 100755 --- a/bin/get-version-number +++ b/bin/get-version-number @@ -9,7 +9,10 @@ if(!process.env["TW5_BUILD_TIDDLYWIKI"]) { var fs = require("fs"), path = require("path"); -var json = JSON.parse(fs.readFileSync(path.resolve(path.dirname(process.env["TW5_BUILD_TIDDLYWIKI"]),"./package.json"),"utf8")); +var filename = path.resolve(path.dirname(process.env["TW5_BUILD_TIDDLYWIKI"]),"./package.json"), + json = JSON.parse(fs.readFileSync(filename,"utf8")); + +console.log("Extracting version from ",filename) if(!json.version) { throw "Missing version number in package.json";