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

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

Issue 21147002: Install before starting the server if the lockfile is out of date. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 5 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
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/entrypoint.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fea0f1fcdf6df1bc1d6ca5696f3d4321cfb9a15f..ce8db31dd2ea7328041b23ae7a0ac9ad0e4ab491 100644
--- a/sdk/lib/_internal/pub/lib/src/command/serve.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/serve.dart
@@ -37,7 +37,18 @@ class ServeCommand extends PubCommand {
// to pub's top-level error-handling machinery.
var completer = new Completer();
- return PubPackageProvider.create(entrypoint).then((provider) {
+ return new Future.value().then((_) {
+ // The server relies on an up-to-date lockfile, so install first if
+ // needed.
+ if (!entrypoint.isLockFileUpToDate()) {
+ log.message("Dependencies have changed, installing...");
+ return entrypoint.installDependencies().then((_) {
+ log.message("Dependencies installed!");
+ });
+ }
+ }).then((_) {
+ return PubPackageProvider.create(entrypoint);
+ }).then((provider) {
var port;
try {
port = int.parse(commandOptions['port']);
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/entrypoint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698