Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use yaml config for install-app script #367

Open
wants to merge 4 commits into
base: v2.x/staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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