Chromium Code Reviews| 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..."); |
|
nweiz
2013/07/30 19:34:36
"have changed since the pubspec.lock was last gene
Bob Nystrom
2013/07/30 21:35:32
I think it's better to not mention the lock file h
|
| + return entrypoint.installDependencies().then((_) { |
| + log.message("Dependencies installed!"); |
| + }); |
| + } |
| + }).then((_) { |
| + return PubPackageProvider.create(entrypoint); |
| + }).then((provider) { |
| var port; |
| try { |
| port = int.parse(commandOptions['port']); |