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

Unified Diff: utils/pub/io.dart

Issue 11151026: Download to a temp dir and rename on success. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 8 years, 2 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/hosted_source.dart ('k') | utils/pub/version_solver.dart » ('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 bef2b2ae37e5f7d648c3203e3ad66e9c6cafec23..6e45a7412a1f26eb3c378f1f10d10c14097e5f5a 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -283,6 +283,10 @@ Future<Directory> cleanDir(dir) {
});
}
+/// Renames (i.e. moves) the directory [from] to [to]. Returns a [Future] with
+/// the destination directory.
+Future<Directory> renameDir(from, String to) =>_getDirectory(from).rename(to);
+
/**
* Creates a new symlink that creates an alias from [from] to [to], both of
* which can be a [String], [File], or [Directory]. Returns a [Future] which
@@ -690,6 +694,7 @@ Future<bool> _extractTarGzWindows(InputStream stream, String destination) {
}).chain((result) {
if (result.exitCode != 0) {
throw 'Could not un-gzip (exit code ${result.exitCode}). Error:\n'
+ '${Strings.join(result.stdout, "\n")}\n'
'${Strings.join(result.stderr, "\n")}';
}
« no previous file with comments | « utils/pub/hosted_source.dart ('k') | utils/pub/version_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698