fixup to allow license to run front and back end

This commit is contained in:
Stewart Allen 2022-09-01 11:19:13 -04:00
commit 6bc4284630
2 changed files with 4 additions and 3 deletions

1
app.js
View file

@ -58,7 +58,6 @@ function init(mod) {
log = mod.log;
dversion = debug ? `_${version}` : version;
// dversion = debug ? Date.now().toString(36) : version;
cacheDir = mod.util.datadir("cache");
const approot = "main/gapp";

View file

@ -1,9 +1,11 @@
(function() {
const is_self = typeof(self) !== 'undefined';
let terms = {
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE: "See the license.md file included with the source distribution",
VERSION: this.debug_version || "3.5.D4"
VERSION: (is_self ? self : this).debug_version || "3.5.D4"
};
if (typeof(module) === 'object') {
@ -11,7 +13,7 @@
}
// allow license to be required() by app without gapp
if (typeof(self) !== 'undefined' && self.gapp) {
if (is_self && self.gapp) {
let app = self.gapp;
app.license = terms.LICENSE;
app.version = terms.VERSION;