File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ Future<void> createCommand(ArgResults command) async {
24
24
'Choose a name for your project: ' ,
25
25
desc: 'Note: this must be a valid dart identifier (no dashes). '
26
26
'For example: my_game' ,
27
+ validate: (it) => ! it.contains ('-' ) && it != 'test' ,
27
28
);
28
29
29
30
final org = getString (
@@ -34,6 +35,7 @@ Future<void> createCommand(ArgResults command) async {
34
35
desc: 'Note: this is a dot separated list of "packages", '
35
36
'normally in reverse domain notation. '
36
37
'For example: org.flame_engine.games' ,
38
+ validate: (it) => ! it.contains ('-' ),
37
39
);
38
40
39
41
final versions = FlameVersionManager .singleton.versions;
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ String getString(
17
17
String message, {
18
18
required bool isInteractive,
19
19
String ? desc,
20
+ bool Function (String )? validate,
20
21
}) {
21
22
var value = results[name] as String ? ;
22
23
if (! isInteractive) {
@@ -29,7 +30,7 @@ String getString(
29
30
if (desc != null ) {
30
31
stdout.write (ansi.darkGray.wrap ('\n $desc \u {1B}[1A\r ' ));
31
32
}
32
- value = prompts.get (message, validate: (it) => ! it. contains ( '-' ) );
33
+ value = prompts.get (message, validate: validate );
33
34
if (desc != null ) {
34
35
stdout.write ('\r\u {1B}[K' );
35
36
}
You can’t perform that action at this time.
0 commit comments