Skip to content

Commit

Permalink
fix(config): offer better default database name when installing (#454)
Browse files Browse the repository at this point in the history
closes #453 
- make the default database name be based off of the current working directory basename
  • Loading branch information
TomChantler authored and acburdine committed Aug 17, 2017
1 parent cc8c081 commit c40d628
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/commands/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class ConfigCommand extends Command {

getConfigPrompts(argv) {
const validator = require('validator');
const path = require('path');

let prompts = [];

if (!argv.url) {
Expand Down Expand Up @@ -119,7 +121,7 @@ class ConfigCommand extends Command {
type: 'input',
name: 'dbname',
message: 'Enter your Ghost database name:',
default: this.instance.config.get('database.connection.database', `ghost_${this.system.environment}`)
default: this.instance.config.get('database.connection.database', `ghost_${this.system.environment}_${path.basename(process.cwd())}`)
});
}
}
Expand Down

0 comments on commit c40d628

Please sign in to comment.