File tree Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,8 @@ abstract class CommandBase extends Command<int> {
45
45
help: 'Enables verbose logging.' );
46
46
}
47
47
48
- Future <int > runCore (String command) async {
49
- await checkPubspecLock ();
50
-
51
- var buildRunnerScript = await _buildRunnerScript ();
52
-
53
- final arguments = [command];
54
-
48
+ List <String > getArgs () {
49
+ var arguments = < String > [];
55
50
if ((argResults[_release] as bool ) ?? releaseDefault) {
56
51
arguments.add ('--$_release ' );
57
52
}
@@ -64,6 +59,15 @@ abstract class CommandBase extends Command<int> {
64
59
if (argResults[_verbose] as bool ) {
65
60
arguments.add ('--$_verbose ' );
66
61
}
62
+ return arguments;
63
+ }
64
+
65
+ Future <int > runCore (String command) async {
66
+ await checkPubspecLock ();
67
+
68
+ var buildRunnerScript = await _buildRunnerScript ();
69
+
70
+ final arguments = [command]..addAll (getArgs ());
67
71
68
72
var exitCode = 0 ;
69
73
Original file line number Diff line number Diff line change @@ -30,6 +30,22 @@ class ServeCommand extends CommandBase {
30
30
help: 'Enables logging for each request to the server.' );
31
31
}
32
32
33
+ @override
34
+ List <String > getArgs () {
35
+ var arguments = super .getArgs ();
36
+
37
+ var hostname = argResults['hostname' ] as String ;
38
+ if (hostname != null ) {
39
+ arguments.addAll (['--hostname' , hostname]);
40
+ }
41
+
42
+ if (argResults['log-requests' ] == true ) {
43
+ arguments.add ('--log-requests' );
44
+ }
45
+
46
+ return arguments;
47
+ }
48
+
33
49
@override
34
50
Future <int > run () => runCore ('serve' );
35
51
}
You can’t perform that action at this time.
0 commit comments