Skip to content

Commit

Permalink
Store the database in config directory
Browse files Browse the repository at this point in the history
  • Loading branch information
thani-sh committed Sep 2, 2016
1 parent 148a4af commit e27c30f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if (_commander2.default.staticDir) {
// The addon database service is disabled by default for now
// It should be enabled with the --enable-db for dev server
if (_commander2.default.enableDb) {
var dbPath = _commander2.default.dbPath || './.storybook/addon-db.json';
var dbPath = _commander2.default.dbPath || _path2.default.resolve(configDir, 'addon-db.json');
_shelljs2.default.cp(dbPath, outputDir);
}

Expand Down
2 changes: 1 addition & 1 deletion dist/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ app.use((0, _middleware2.default)(configDir));
// The addon database service is disabled by default for now
// It should be enabled with the --enable-db for dev server
if (_commander2.default.enableDb) {
var dbPath = _commander2.default.dbPath || './.storybook/addon-db.json';
var dbPath = _commander2.default.dbPath || _path2.default.resolve(configDir, 'addon-db.json');
app.use('/db', (0, _middleware4.default)(dbPath));
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if (program.staticDir) {
// The addon database service is disabled by default for now
// It should be enabled with the --enable-db for dev server
if (program.enableDb) {
const dbPath = program.dbPath || './.storybook/addon-db.json';
const dbPath = program.dbPath || path.resolve(configDir, 'addon-db.json')
shelljs.cp(dbPath, outputDir);
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ app.use(storybook(configDir));
// The addon database service is disabled by default for now
// It should be enabled with the --enable-db for dev server
if (program.enableDb) {
const dbPath = program.dbPath || './.storybook/addon-db.json';
const dbPath = program.dbPath || path.resolve(configDir, 'addon-db.json')
app.use('/db', datastore(dbPath));
}

Expand Down

0 comments on commit e27c30f

Please sign in to comment.