Skip to content

Commit 504aeb0

Browse files
Update prompts with better ux
1 parent bd206e5 commit 504aeb0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/utils/prompts.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,23 @@ function getCreatePrompts() {
66
type: 'input',
77
name: 'directory',
88
message: 'Name of new site directory:',
9+
validate: function (text) {
10+
if (text.length == 0) {
11+
return 'You must specify the directory name';
12+
}
13+
return true;
14+
}
915
},
1016
{
1117
type: 'input',
1218
name: 'domain',
1319
message: 'Domain to use:',
20+
default: function (answers) {
21+
return answers.directory+'.dev';
22+
},
23+
filter: function (val) {
24+
return val.toLowerCase();
25+
}
1426
},
1527
/*
1628
//TODO: Work in Progress

0 commit comments

Comments
 (0)