From 6bc4284630c830a5812c6114d453a01c2a7d7e20 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 1 Sep 2022 11:19:13 -0400 Subject: [PATCH] fixup to allow license to run front and back end --- app.js | 1 - src/moto/license.js | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index d019fee3..438322cc 100644 --- a/app.js +++ b/app.js @@ -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"; diff --git a/src/moto/license.js b/src/moto/license.js index 07228b9f..084ea31c 100644 --- a/src/moto/license.js +++ b/src/moto/license.js @@ -1,9 +1,11 @@ (function() { + const is_self = typeof(self) !== 'undefined'; + let terms = { COPYRIGHT: "Copyright (C) Stewart Allen - 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;