stack can now load from stored config

This commit is contained in:
Lloyd Brookes
2016-07-05 21:40:20 +01:00
parent 7910a424c2
commit ac8994032c

View File

@ -21,9 +21,12 @@ class LocalWebServer {
const commandLineArgs = require('command-line-args')
const commandLineUsage = require('command-line-usage')
const cli = require('../lib/cli-data')
const loadConfig = require('config-master')
const stored = loadConfig('local-web-server')
/* manually scan for any --stack passed, as we may need to display stack options */
const stackPaths = initOptions.stack || []
const stackPaths = initOptions.stack || stored.stack || []
const stackIndex = process.argv.indexOf('--stack')
if (stackIndex > -1) {
for (var i = stackIndex + 1; i < process.argv.length; i++) {
@ -89,8 +92,6 @@ class LocalWebServer {
}
/* combine in stored config */
const loadConfig = require('config-master')
const stored = loadConfig('local-web-server')
options = Object.assign({ port: 8000 }, initOptions, stored, options.server, options.middleware, options.misc)
this.options = options