Skip to content

Commit

Permalink
fix(config): add default dbpath when db is sqlite
Browse files Browse the repository at this point in the history
closes TryGhost#349
- add defaultValue function to dbpath argument
  • Loading branch information
acburdine committed Jul 12, 2017
1 parent 9408737 commit 111b56a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/commands/config/advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ module.exports = {
description: 'Path to the database file (sqlite3 only)',
configPath: 'database.connection.filename',
type: 'string',
group: 'Database Options:'
group: 'Database Options:',
defaultValue: (config, environment) => {
if (config.get('database.client') !== 'sqlite3') {
return null;
}

let dbFile = (environment === 'production') ? 'ghost.db' : 'ghost-dev.db';
return `./content/data/${dbFile}`;
}
},
dbhost: {
description: 'Database host',
Expand Down

0 comments on commit 111b56a

Please sign in to comment.