Skip to content

Commit

Permalink
Prefix config environment variables
Browse files Browse the repository at this point in the history
Vairables like HOSTNAME have other values
which can cause unexpected errors. Fixes storybookjs#502
  • Loading branch information
thani-sh committed Sep 28, 2016
1 parent c46a341 commit 7958c12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ program
// The key is the field created in `program` variable for
// each command line argument. Value is the env variable.
getEnvConfig(program, {
staticDir: 'STATIC_DIR',
outputDir: 'OUTPUT_DIR',
configDir: 'CONFIG_DIR',
staticDir: 'SBCONFIG_STATIC_DIR',
outputDir: 'SBCONFIG_OUTPUT_DIR',
configDir: 'SBCONFIG_CONFIG_DIR',
});

const configDir = program.configDir || './.storybook';
Expand Down
10 changes: 5 additions & 5 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ program
// The key is the field created in `program` variable for
// each command line argument. Value is the env variable.
getEnvConfig(program, {
port: 'PORT',
host: 'HOSTNAME',
staticDir: 'STATIC_DIR',
configDir: 'CONFIG_DIR',
dontTrack: 'DO_NOT_TRACK',
port: 'SBCONFIG_PORT',
host: 'SBCONFIG_HOSTNAME',
staticDir: 'SBCONFIG_STATIC_DIR',
configDir: 'SBCONFIG_CONFIG_DIR',
dontTrack: 'SBCONFIG_DO_NOT_TRACK',
});

if (program.dontTrack) {
Expand Down

0 comments on commit 7958c12

Please sign in to comment.