Skip to content

Commit

Permalink
When the staticDir is set by the env, capure an error.(_commander2.de…
Browse files Browse the repository at this point in the history
…fault.staticDir.forEach is not a function)
  • Loading branch information
bshy522 committed Sep 8, 2016
1 parent 048860a commit 54962a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <dir-names>', 'Directory where to load static files from', parseList)
.option('-s, --static-dir <dir-names>', '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')
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 54962a8

Please sign in to comment.