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

Unified Diff: sdk/lib/_internal/pub/lib/src/entrypoint.dart

Issue 23272002: Command to print paths to dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unused variable. Created 7 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
Index: sdk/lib/_internal/pub/lib/src/entrypoint.dart
diff --git a/sdk/lib/_internal/pub/lib/src/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
index 30f42f706c71530a09e89164a1634dbd656d2e23..9ec81ec0173738861b7b3789333a3cbe8aa5d660 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -53,6 +53,9 @@ class Entrypoint {
/// The path to the entrypoint's "packages" directory.
String get packagesDir => path.join(root.dir, 'packages');
+ /// `true` if the entrypoint package currently has a lock file.
+ bool get lockFileExists => entryExists(_lockFilePath);
+
/// Ensures that the package identified by [id] is installed to the directory.
/// Returns the resolved [PackageId].
///
@@ -146,9 +149,8 @@ class Entrypoint {
/// Loads the list of concrete package versions from the `pubspec.lock`, if it
/// exists. If it doesn't, this completes to an empty [LockFile].
LockFile loadLockFile() {
- var lockFilePath = path.join(root.dir, 'pubspec.lock');
- if (!entryExists(lockFilePath)) return new LockFile.empty();
- return new LockFile.load(lockFilePath, cache.sources);
+ if (!lockFileExists) return new LockFile.empty();
+ return new LockFile.load(_lockFilePath, cache.sources);
}
/// Determines whether or not the lockfile is out of date with respect to the
@@ -181,6 +183,9 @@ class Entrypoint {
return true;
}
+ /// The path to the entrypoint package's lockfile.
+ String get _lockFilePath => path.join(root.dir, 'pubspec.lock');
+
/// Saves a list of concrete package versions to the `pubspec.lock` file.
void _saveLockFile(List<PackageId> packageIds) {
var lockFile = new LockFile.empty();

Powered by Google App Engine
This is Rietveld 408576698