Skip to content

Commit

Permalink
Allow to use yaml config for install-app script
Browse files Browse the repository at this point in the history
Signed-off-by: Leonty Chudinov <lchudinov@rocketsoftware.com>
  • Loading branch information
Leonty Chudinov committed Jan 24, 2022
1 parent 5faf06d commit 85a238b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions utils/install-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const packagingUtils = require('./packaging-utils');
const serverUtils = require('../lib/util');
const jsonUtils = require('../lib/jsonUtils');
const rmrf = require('rimraf');
const yamlConfig = require('./yamlConfig');


//assuming that this is file isnt being called from another that is already using the logger... else expect strange logs
//TO DO - Sean - bootstrap logger
Expand Down Expand Up @@ -67,13 +69,15 @@ if(calledViaCLI){
pluginsDir = serverUtils.normalizePath(userInput.pluginsDir);
} else {
userInput.zluxConfig = serverUtils.normalizePath(userInput.zluxConfig);
const zluxConfig = jsonUtils.parseJSONWithComments(userInput.zluxConfig);
pluginsDir = serverUtils.normalizePath(
zluxConfig.pluginsDir,
process.cwd());
if (!path.isAbsolute(pluginsDir)){
//zluxconfig paths relative to whereever that file is
path.normalize(userInput.zluxConfig,pluginsDir);
const zluxConfig = yamlConfig.getConfig(userInput.zluxConfig, undefined, ['app-server', 'zss']);
if (zluxConfig && typeof zluxConfig.pluginsDir === 'string') {
pluginsDir = serverUtils.normalizePath(
zluxConfig.pluginsDir,
process.cwd());
if (!path.isAbsolute(pluginsDir)){
//zluxconfig paths relative to whereever that file is
path.normalize(userInput.zluxConfig,pluginsDir);
}
}
}
if (isFile(pluginsDir)) {
Expand Down

0 comments on commit 85a238b

Please sign in to comment.