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

Unified Diff: utils/pub/io.dart

Issue 10378044: Rely on dart:io to deal with symlinks in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index e6c79ca853701c5e85fef70008b5c24ef73d3ff2..371174f51736bd00cfda7db0a941a2ec9310a226 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -91,13 +91,6 @@ Future<bool> exists(path) {
* the result.
*/
Future<bool> fileExists(file) {
- // TODO(nweiz): Currently File#exists will not detect the existence of
- // symlinks. Issue 2765
- return runProcess('stat', [_getPath(file)]).
- transform((result) => result.exitCode == 0);
-
- // Real code:
- /*
final completer = new Completer<bool>();
file = new File(_getPath(file));
@@ -105,7 +98,6 @@ Future<bool> fileExists(file) {
file.exists((exists) => completer.complete(exists));
return completer.future;
- */
}
/**
@@ -200,31 +192,12 @@ Future<Directory> createTempDir(dir) {
* [Directory]. Returns a [Future] that completes when the deletion is done.
*/
Future<Directory> deleteDir(dir) {
- // TODO(rnystrom): Hack! Temporary! Right now, dart:io's Directory delete
- // method can't handle directories with symlinks, which is exactly what pub
- // creates and deletes. Instead, we'll just shell out to 'rm'. Remove this
- // when dartbug.com/2646 is fixed.
- dir = _getDirectory(dir);
-
- // Sanity check!
- if (dir.path == '/' ||
- dir.path == '.' ||
- dir.path == '..' ||
- dir.path == '~' ||
- dir.path == '*') throw "(O.o) I don't think you want to do that!";
-
- return runProcess('rm', ['-rf', dir.path]).transform((_) => dir);
- // End hack!
-
- // Real code:
- /*
final completer = new Completer<Directory>();
dir = _getDirectory(dir);
dir.onError = (error) => completer.completeException(error);
dir.deleteRecursively(() => completer.complete(dir));
return completer.future;
- */
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698