stack can now load from stored config
This commit is contained in:
@ -21,9 +21,12 @@ class LocalWebServer {
|
|||||||
const commandLineArgs = require('command-line-args')
|
const commandLineArgs = require('command-line-args')
|
||||||
const commandLineUsage = require('command-line-usage')
|
const commandLineUsage = require('command-line-usage')
|
||||||
const cli = require('../lib/cli-data')
|
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 */
|
/* 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')
|
const stackIndex = process.argv.indexOf('--stack')
|
||||||
if (stackIndex > -1) {
|
if (stackIndex > -1) {
|
||||||
for (var i = stackIndex + 1; i < process.argv.length; i++) {
|
for (var i = stackIndex + 1; i < process.argv.length; i++) {
|
||||||
@ -89,8 +92,6 @@ class LocalWebServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* combine in stored config */
|
/* 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)
|
options = Object.assign({ port: 8000 }, initOptions, stored, options.server, options.middleware, options.misc)
|
||||||
this.options = options
|
this.options = options
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user