From ac8994032c44a0dccd6628f59cb430b09f6b225a Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Tue, 5 Jul 2016 21:40:20 +0100 Subject: [PATCH] stack can now load from stored config --- lib/local-web-server.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/local-web-server.js b/lib/local-web-server.js index 802d0b0..d9143e1 100644 --- a/lib/local-web-server.js +++ b/lib/local-web-server.js @@ -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