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

Unified Diff: utils/pub/io.dart

Issue 10824095: Get basic Windows stuff working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove debug variable. Created 8 years, 5 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 | utils/tests/pub/pub.status » ('j') | 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 c034ff13df318f5b28d978920786c8a210344010..b08e65ae1a85cc1b41ebf6827862fa31075ae7f5 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -27,7 +27,7 @@ void printError(value) {
* [File] objects.
*/
String join(part1, [part2, part3, part4]) {
- final parts = _getPath(part1).split('/');
+ final parts = _getPath(part1).replaceAll('\\', '/').split('/');
for (final part in [part2, part3, part4]) {
if (part == null) continue;
@@ -152,20 +152,21 @@ Future<Directory> ensureDir(path) {
return dirExists(path).chain((exists) {
if (exists) return new Future.immediate(new Directory(path));
- return ensureDir(dirname(path));
- }).chain((_) {
- var completer = new Completer<Directory>();
- var future = createDir(path);
- future.handleException((error) {
- if (error is! DirectoryIOException) return false;
- // Error 17 means the directory already exists.
- if (error.osError.errorCode != 17) return false;
-
- completer.complete(_getDirectory(path));
- return true;
+ return ensureDir(dirname(path)).chain((_) {
+ var completer = new Completer<Directory>();
+ var future = createDir(path);
+ future.handleException((error) {
+ if (error is! DirectoryIOException) return false;
+ // Error 17 means the directory already exists (or 183 on Windows).
+ if (error.osError.errorCode != 17 &&
+ error.osError.errorCode != 183) return false;
+
+ completer.complete(_getDirectory(path));
+ return true;
+ });
+ future.then(completer.complete);
+ return completer.future;
});
- future.then(completer.complete);
- return completer.future;
});
}
« no previous file with comments | « no previous file | utils/tests/pub/pub.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698