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

Side by Side Diff: utils/pub/io.dart

Issue 11417102: Avoid passing absolute path to 7zip. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Helper functionality to make working with IO easier. 6 * Helper functionality to make working with IO easier.
7 */ 7 */
8 library io; 8 library io;
9 9
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 for (var file in files) { 683 for (var file in files) {
684 if (new Path(file).extension == 'tar') { 684 if (new Path(file).extension == 'tar') {
685 tarFile = file; 685 tarFile = file;
686 break; 686 break;
687 } 687 }
688 } 688 }
689 689
690 if (tarFile == null) throw 'The gzip file did not contain a tar file.'; 690 if (tarFile == null) throw 'The gzip file did not contain a tar file.';
691 691
692 // Untar the archive into the destination directory. 692 // Untar the archive into the destination directory.
693 return runProcess(command, ['x', '-o"$destination"', tarFile], 693 return runProcess(command, ['x', tarFile], workingDir: destination);
694 workingDir: tempDir);
695 }).chain((result) { 694 }).chain((result) {
696 if (result.exitCode != 0) { 695 if (result.exitCode != 0) {
697 throw 'Could not un-tar (exit code ${result.exitCode}). Error:\n' 696 throw 'Could not un-tar (exit code ${result.exitCode}). Error:\n'
698 '${Strings.join(result.stdout, "\n")}\n' 697 '${Strings.join(result.stdout, "\n")}\n'
699 '${Strings.join(result.stderr, "\n")}'; 698 '${Strings.join(result.stderr, "\n")}';
700 } 699 }
701 700
702 // Clean up the temp directory. 701 // Clean up the temp directory.
703 // TODO(rnystrom): Should also delete this if anything fails. 702 // TODO(rnystrom): Should also delete this if anything fails.
704 return deleteDir(tempDir); 703 return deleteDir(tempDir);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 return new Directory(entry); 761 return new Directory(entry);
763 } 762 }
764 763
765 /** 764 /**
766 * Gets a [Uri] for [uri], which can either already be one, or be a [String]. 765 * Gets a [Uri] for [uri], which can either already be one, or be a [String].
767 */ 766 */
768 Uri _getUri(uri) { 767 Uri _getUri(uri) {
769 if (uri is Uri) return uri; 768 if (uri is Uri) return uri;
770 return new Uri.fromString(uri); 769 return new Uri.fromString(uri);
771 } 770 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698