From 54962a81187e521179dcfa2285b42c60ff4dfc96 Mon Sep 17 00:00:00 2001 From: larry Date: Thu, 8 Sep 2016 12:39:26 +0800 Subject: [PATCH] When the staticDir is set by the env, capure an error.(_commander2.default.staticDir.forEach is not a function) --- src/server/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/index.js b/src/server/index.js index b3e5451cf574..980e1e947fef 100755 --- a/src/server/index.js +++ b/src/server/index.js @@ -16,7 +16,7 @@ program .version(packageJson.version) .option('-p, --port [number]', 'Port to run Storybook (Required)', parseInt) .option('-h, --host [string]', 'Host to run Storybook') - .option('-s, --static-dir ', 'Directory where to load static files from', parseList) + .option('-s, --static-dir ', 'Directory where to load static files from') .option('-c, --config-dir [dir-name]', 'Directory where to load Storybook configurations from') .option('-d, --db-path [db-file]', 'File where to store addon database JSON file') .option('--enable-db', 'Enable the (experimental) addon database service on dev-server') @@ -53,6 +53,7 @@ if (program.host) { const app = express(); if (program.staticDir) { + program.staticDir = parseList(program.staticDir); program.staticDir.forEach(dir => { const staticPath = path.resolve(dir); if (!fs.existsSync(staticPath)) {