cleanup and minor fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-01-28 21:55:53 +03:00
parent 1ef859573e
commit 25f895aaf0
2 changed files with 5 additions and 30 deletions

View File

@ -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

View File

@ -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 })