@teams-max/mwsp 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/utils/defineConfig.js
CHANGED
|
@@ -6,15 +6,17 @@ var _require = require("./index"),
|
|
|
6
6
|
function defineConfig(config) {
|
|
7
7
|
var cfg = getCfg();
|
|
8
8
|
var ASG_DIR = cfg.ASG_DIR;
|
|
9
|
-
var
|
|
10
|
-
env.ASG_DIR = ASG_DIR;
|
|
9
|
+
var nextAsgEnv = process.env.ASG_DIR || ASG_DIR;
|
|
11
10
|
if (!process.env.ASG_DIR) {
|
|
11
|
+
logStep('Process ASG_DIR not set, and use scoped environment');
|
|
12
|
+
}
|
|
13
|
+
if (!nextAsgEnv) {
|
|
12
14
|
logStep('The Asgard directory does not exist, using default config...');
|
|
13
15
|
return config;
|
|
14
16
|
}
|
|
15
17
|
var iConfigFromPlugins = null;
|
|
16
18
|
try {
|
|
17
|
-
iConfigFromPlugins = require(path.join(
|
|
19
|
+
iConfigFromPlugins = require(path.join(nextAsgEnv, 'base', 'pluginConfig.js'));
|
|
18
20
|
} catch (error) {
|
|
19
21
|
printErrorAndExit('The Asgard directory does not exist.', "Reason: ".concat(error.message));
|
|
20
22
|
return;
|
|
@@ -4,16 +4,18 @@ var { logStep, printErrorAndExit, getCfg } = require("./index");
|
|
|
4
4
|
function defineConfig(config) {
|
|
5
5
|
const cfg = getCfg();
|
|
6
6
|
const { ASG_DIR } = cfg;
|
|
7
|
-
const
|
|
8
|
-
env.ASG_DIR = ASG_DIR;
|
|
7
|
+
const nextAsgEnv = process.env.ASG_DIR || ASG_DIR;
|
|
9
8
|
if (!process.env.ASG_DIR) {
|
|
9
|
+
logStep("Process ASG_DIR not set, and use scoped environment");
|
|
10
|
+
}
|
|
11
|
+
if (!nextAsgEnv) {
|
|
10
12
|
logStep("The Asgard directory does not exist, using default config...");
|
|
11
13
|
return config;
|
|
12
14
|
}
|
|
13
15
|
let iConfigFromPlugins = null;
|
|
14
16
|
try {
|
|
15
17
|
iConfigFromPlugins = require(path.join(
|
|
16
|
-
|
|
18
|
+
nextAsgEnv,
|
|
17
19
|
"base",
|
|
18
20
|
"pluginConfig.js"
|
|
19
21
|
));
|