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

Unified Diff: lib/src/entrypoint.dart

Issue 1277633004: Auto-run "pub get" more for "pub run". (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 4 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 | test/run/allows_dart_extension_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/entrypoint.dart
diff --git a/lib/src/entrypoint.dart b/lib/src/entrypoint.dart
index ed0d087ca454efa1817e9622033f882a29fbc3fc..ceb277903edffe9ffe847de824d034602feea06f 100644
--- a/lib/src/entrypoint.dart
+++ b/lib/src/entrypoint.dart
@@ -425,37 +425,26 @@ class Entrypoint {
/// Gets dependencies if the lockfile is out of date with respect to the
/// pubspec.
- Future ensureLockFileIsUpToDate() {
- return new Future.sync(() {
- // If we don't have a current lock file, we definitely need to install.
- if (!_isLockFileUpToDate(lockFile)) {
- if (lockFileExists) {
- log.message(
- "Your pubspec has changed, so we need to update your lockfile:");
- } else {
- log.message(
- "You don't have a lockfile, so we need to generate that:");
- }
-
- return false;
- }
-
- // If we do have a lock file, we still need to make sure the packages
- // are actually installed. The user may have just gotten a package that
+ Future ensureLockFileIsUpToDate() async {
+ if (!lockFileExists) {
+ log.message(
+ "You don't have a lockfile, so we need to generate that:");
+ } else if (_isLockFileUpToDate(lockFile)) {
+ // If we do have a lock file, we still need to make sure the packages are
+ // actually installed. The user may have just gotten a package that
// includes a lockfile.
- return _arePackagesAvailable(lockFile).then((available) {
- if (!available) {
- log.message(
- "You are missing some dependencies, so we need to install them "
- "first:");
- }
+ if (await _arePackagesAvailable(lockFile)) return;
- return available;
- });
- }).then((upToDate) {
- if (upToDate) return null;
- return acquireDependencies(SolveType.GET);
- });
+ // If we don't have a current lock file, we definitely need to install.
+ log.message(
+ "You are missing some dependencies, so we need to install them "
+ "first:");
+ } else {
+ log.message(
+ "Your pubspec has changed, so we need to update your lockfile:");
+ }
+
+ await acquireDependencies(SolveType.GET);
}
/// Loads the package graph for the application and all of its transitive
« no previous file with comments | « no previous file | test/run/allows_dart_extension_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698