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

Unified Diff: utils/pub/entrypoint.dart

Issue 13132002: Version 0.4.3.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 9 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 | « utils/pub/command_lish.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/entrypoint.dart
===================================================================
--- utils/pub/entrypoint.dart (revision 20601)
+++ utils/pub/entrypoint.dart (working copy)
@@ -74,11 +74,11 @@
var future = defer(() {
ensureDir(path.dirname(packageDir));
- if (dirExists(packageDir)) {
+ if (entryExists(packageDir)) {
// TODO(nweiz): figure out when to actually delete the directory, and
// when we can just re-use the existing symlink.
log.fine("Deleting package directory for ${id.name} before install.");
- deleteDir(packageDir);
+ deleteEntry(packageDir);
}
if (id.source.shouldCache) {
@@ -210,7 +210,7 @@
/// exists. If it doesn't, this completes to an empty [LockFile].
LockFile loadLockFile() {
var lockFilePath = path.join(root.dir, 'pubspec.lock');
- if (!fileExists(lockFilePath)) return new LockFile.empty();
+ if (!entryExists(lockFilePath)) return new LockFile.empty();
return new LockFile.load(lockFilePath, cache.sources);
}
@@ -298,17 +298,7 @@
Future _linkSecondaryPackageDir(String dir) {
return defer(() {
var symlink = path.join(dir, 'packages');
- // The order of if tests is significant here. fileExists() will return
- // true for a symlink (broken or not) but deleteFile() cannot be used
- // to delete a broken symlink on Windows. So we test for the directory
- // first since deleteDir() does work on symlinks.
- // TODO(rnystrom): Make deleteFile() work for symlinks on Windows so this
- // doesn't matter.
- if (dirExists(symlink)) {
- deleteDir(symlink);
- } else if (fileExists(symlink)) {
- deleteFile(symlink);
- }
+ if (entryExists(symlink)) deleteEntry(symlink);
return createSymlink(packagesDir, symlink, relative: true);
});
}
« no previous file with comments | « utils/pub/command_lish.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698