Chromium Code Reviews| Index: utils/pub/hosted_source.dart |
| diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart |
| index 4ca407420b45dc165e8bc40f6840f568ee0837f6..5992644ee0960fac1b254b3bbffaf6c4f78f9c7b 100644 |
| --- a/utils/pub/hosted_source.dart |
| +++ b/utils/pub/hosted_source.dart |
| @@ -86,17 +86,16 @@ 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. |
| - var rename = renameDir(tempDir, destPath); |
| // TODO(rnystrom): Awful hack. On Windows, we see cases where the extract |
|
Anders Johnsen
2012/10/16 07:59:47
Move inside if (windows).
Johnni Winther
2012/10/16 08:08:01
Done.
|
| // 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 (io.Platform.operatingSystem == "windows") { |
| - rename = sleep(2000).chain((_) => rename); |
| + return sleep(2000).chain((_) => renameDir(tempDir, destPath)); |
| + } else { |
| + return renameDir(tempDir, destPath); |
| } |
| - |
| - return rename; |
| }).transform((_) => true); |
| } |