Skip to content

Commit c40d628

Browse files
TomChantleracburdine
authored andcommitted
fix(config): offer better default database name when installing (#454)
closes #453 - make the default database name be based off of the current working directory basename
1 parent cc8c081 commit c40d628

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/commands/config/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ class ConfigCommand extends Command {
7171

7272
getConfigPrompts(argv) {
7373
const validator = require('validator');
74+
const path = require('path');
75+
7476
let prompts = [];
7577

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

0 commit comments

Comments
 (0)