Skip to content

Commit 7679d59

Browse files
give default value when create
1 parent 0bcf758 commit 7679d59

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ function runCommand() {
5757
const passedCmd = process.argv.slice( 2 );
5858

5959
// No command specified or invalid command.
60-
if ( ! passedCmd.length || ! ( passedCmd[0] in commands ) ) {
60+
if ( ! passedCmd.length || ! ( passedCmd in commands ) ) {
6161
create({ directory: passedCmd[0] });
6262
}
6363

64-
//cli.parse( process.argv );
64+
cli.parse( process.argv );
6565
}
6666

6767
function longDescFn( k ) {

src/utils/prompts.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ function getCreatePrompts(params) {
1313
}
1414
return true;
1515
},
16-
default: params.directory,
16+
default: function(){
17+
if( '' === params.directory ){
18+
return 'wplocaldocker';
19+
}else{
20+
return params.directory+'.dev';
21+
}
22+
},
1723
when: function (answers) {
1824
return ( '' === params.directory );
1925
}

0 commit comments

Comments
 (0)