Index: sdk/lib/_internal/pub/lib/src/command/serve.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/command/serve.dart b/sdk/lib/_internal/pub/lib/src/command/serve.dart |
index 1d7db1562df5e226494c9c45b9920f8d0eec1719..0283c2df87c30e106f871d0b345e687018c1763c 100644 |
--- a/sdk/lib/_internal/pub/lib/src/command/serve.dart |
+++ b/sdk/lib/_internal/pub/lib/src/command/serve.dart |
@@ -46,9 +46,6 @@ class ServeCommand extends BarbackCommand { |
/// `true` if Dart entrypoints should be compiled to JavaScript. |
bool get useDart2JS => commandOptions['dart2js']; |
- /// `true` if the admin server URL should be displayed on startup. |
- bool get logAdminUrl => commandOptions['log-admin-url']; |
- |
BarbackMode get defaultMode => BarbackMode.DEBUG; |
List<String> get defaultSourceDirectories => ["web", "test"]; |
@@ -63,11 +60,8 @@ class ServeCommand extends BarbackCommand { |
commandParser.addOption('port', defaultsTo: '8080', |
help: 'The base port to listen on.'); |
- // TODO(rnystrom): A hidden option to print the URL that the admin server |
- // is bound to on startup. Since this is currently only used for the Web |
- // Socket interface, we don't want to show it to users, but the tests and |
- // Editor need this logged to know what port to bind to. |
- // Remove this (and always log) when #16954 is fixed. |
+ // TODO(nweiz): Remove once editor also removes this. This is now a NOOP. |
+ // Check on http://dartbug.com/20960 |
commandParser.addFlag('log-admin-url', defaultsTo: false, hide: true); |
// TODO(nweiz): Make this public when issue 16954 is fixed. |
@@ -93,13 +87,13 @@ class ServeCommand extends BarbackCommand { |
var directoryLength = sourceDirectories.map((dir) => dir.length) |
.reduce(math.max); |
- var server = await environment.startAdminServer(adminPort); |
- server.results.listen((_) { |
- // The admin server produces no result values. |
- assert(false); |
- }, onError: _fatalError); |
+ if (adminPort != null) { |
+ var server = await environment.startAdminServer(adminPort); |
+ server.results.listen((_) { |
+ // The admin server produces no result values. |
+ assert(false); |
+ }, onError: _fatalError); |
- if (logAdminUrl) { |
log.message("Running admin server on " |
"${log.bold('http://$hostname:${server.port}')}"); |
} |