Skip to content

Commit 85a238b

Browse files
author
Leonty Chudinov
committed
Allow to use yaml config for install-app script
Signed-off-by: Leonty Chudinov <[email protected]>
1 parent 5faf06d commit 85a238b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

utils/install-app.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const packagingUtils = require('./packaging-utils');
1515
const serverUtils = require('../lib/util');
1616
const jsonUtils = require('../lib/jsonUtils');
1717
const rmrf = require('rimraf');
18+
const yamlConfig = require('./yamlConfig');
19+
1820

1921
//assuming that this is file isnt being called from another that is already using the logger... else expect strange logs
2022
//TO DO - Sean - bootstrap logger
@@ -67,13 +69,15 @@ if(calledViaCLI){
6769
pluginsDir = serverUtils.normalizePath(userInput.pluginsDir);
6870
} else {
6971
userInput.zluxConfig = serverUtils.normalizePath(userInput.zluxConfig);
70-
const zluxConfig = jsonUtils.parseJSONWithComments(userInput.zluxConfig);
71-
pluginsDir = serverUtils.normalizePath(
72-
zluxConfig.pluginsDir,
73-
process.cwd());
74-
if (!path.isAbsolute(pluginsDir)){
75-
//zluxconfig paths relative to whereever that file is
76-
path.normalize(userInput.zluxConfig,pluginsDir);
72+
const zluxConfig = yamlConfig.getConfig(userInput.zluxConfig, undefined, ['app-server', 'zss']);
73+
if (zluxConfig && typeof zluxConfig.pluginsDir === 'string') {
74+
pluginsDir = serverUtils.normalizePath(
75+
zluxConfig.pluginsDir,
76+
process.cwd());
77+
if (!path.isAbsolute(pluginsDir)){
78+
//zluxconfig paths relative to whereever that file is
79+
path.normalize(userInput.zluxConfig,pluginsDir);
80+
}
7781
}
7882
}
7983
if (isFile(pluginsDir)) {

0 commit comments

Comments
 (0)