From 25f895aaf000af858a091ce413dd7e256974d0f4 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 28 Jan 2022 21:55:53 +0300 Subject: [PATCH] cleanup and minor fixes... Signed-off-by: Alex A. Naanou --- Viewer/Makefile | 8 +++++--- Viewer/version.js | 27 --------------------------- 2 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 Viewer/version.js diff --git a/Viewer/Makefile b/Viewer/Makefile index 3d9b6caf..e8a2c965 100755 --- a/Viewer/Makefile +++ b/Viewer/Makefile @@ -151,9 +151,10 @@ APP_NAME ?= ImageGrid.Viewer VERSION_FALLBACK ?= 4.0.0a # NOTE: we are not using './ig --version 2> /dev/null' because it will # not work before we do 'npm install'... -VERSION := $(strip $(shell \ +APP_VERSION := $(strip $(shell \ echo 'console.log(require("./package.json").version)' | node - \ || echo $(VERSION_FALLBACK))) +VERSION := $(APP_VERSION) DATE := $(strip $(shell date "+%Y%m%d%H%M")) COMMIT := $(strip $(shell git rev-parse HEAD)) @@ -376,7 +377,7 @@ doc/MAKE: Makefile .PHONY: version version: ## Print version and exit version: - @echo $(VERSION) + @echo $(APP_VERSION) @@ -509,6 +510,7 @@ web: ## Build a browser-runnable package web: $(DIST_DIR)/$(APP_NAME)-$(VERSION)-web.zip + ##-------------------------------------------------------- Electron --- # XXX this can potentially do a build for an existing/matching *.zip in @@ -624,7 +626,7 @@ $(BUILD_INFO): $(CSS_FILES) $(NODE_DIR) $(PROJECT_FILES) \ version.js: package.json cat version.js.tpl \ - | sed 's/\$$VERSION/$(VERSION)/' \ + | sed 's/\$$VERSION/$(APP_VERSION)/' \ > version.js diff --git a/Viewer/version.js b/Viewer/version.js deleted file mode 100644 index ed5ee2df..00000000 --- a/Viewer/version.js +++ /dev/null @@ -1,27 +0,0 @@ -/********************************************************************** -* -* NOTE: version.js is generated automatically by Makefile from a template -* do not edit directly. -* Edit version.js.tpl instead. -* -* -**********************************************************************/ -((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define) -(function(require){ var module={} // make module AMD/node compatible... -/*********************************************************************/ - -// The version lives in package.json -// -// We need to be able to read the correct version in the folowing -// contexts: -// - nodejs/electron - can load JSON directly -// - browser (remote) - can load json via the require('json!package.json') -// - browser (local) - can't get access to .json files -// Thus the only way around this is to generate this file from a template. - -module.version = '4.0.1a-202201282135-el' - - - -/********************************************************************** -* vim:set ts=4 sw=4 : */ return module })