Index: utils/pub/hosted_source.dart |
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart |
index ecffcab5b64147db3ae6d718de377faeb5663668..fbc9248586178b3129ac45cc0a4311c4d69d4748 100644 |
--- a/utils/pub/hosted_source.dart |
+++ b/utils/pub/hosted_source.dart |
@@ -85,7 +85,17 @@ class HostedSource extends Source { |
// Now that the install has succeeded, move it to the real location in |
// the cache. This ensures that we don't leave half-busted ghost |
// directories in the user's pub cache if an install fails. |
- return renameDir(tempDir, destPath); |
+ var rename = renameDir(tempDir, destPath); |
+ |
+ // TODO(rnystrom): Awful hack. On Windows, we see cases where the extract |
kasperl
2012/10/16 05:44:04
This smells like a dart:io bug? Did you file one a
|
+ // has not finished by the time we get here, so the rename fails with a |
+ // "directory in use" error. So, we will just wait a couple of seconds |
+ // before we start. |
+ if (Platform.operatingSystem == "windows") { |
+ rename = sleep(2000).chain((_) => rename); |
+ } |
+ |
+ return rename; |
}).transform((_) => true); |
} |