Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(628)

Unified Diff: sdk/lib/_internal/pub/lib/src/command/serve.dart

Issue 1126403002: pub: don't start the admin server if no --admin-port flag was given. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix tests Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d7e9de5f56f7724bc9cbedec5b36de47d0fa7bbb..e43a9fc2bfa8f6c67b382bf74165e3f3f0d242f6 100644
--- a/sdk/lib/_internal/pub/lib/src/command/serve.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/serve.dart
@@ -98,15 +98,17 @@ 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 (logAdminUrl) {
- log.message("Running admin server on "
- "${log.bold('http://$hostname:${server.port}')}");
+ 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}')}");
+ }
}
// Start up the servers. We pause updates while this is happening so
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart ('k') | sdk/lib/_internal/pub/test/serve/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698