Chromium Code Reviews| Index: utils/pub/io.dart |
| diff --git a/utils/pub/io.dart b/utils/pub/io.dart |
| index bef2b2ae37e5f7d648c3203e3ad66e9c6cafec23..20852ca6f74a5148d9cf899672017738a628d528 100644 |
| --- a/utils/pub/io.dart |
| +++ b/utils/pub/io.dart |
| @@ -283,6 +283,13 @@ 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) { |
| + from = _getDirectory(from); |
| + return from.rename(to); |
|
nweiz
2012/10/15 20:56:27
Style nit: this would be cleaner as a one-liner.
Bob Nystrom
2012/10/15 20:59:23
Done.
|
| +} |
| + |
| /** |
| * 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 +697,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")}'; |
| } |