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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 16831023: Don't use " in process args in pub, after Process escape fix on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// Helper functionality to make working with IO easier. 5 /// Helper functionality to make working with IO easier.
6 library pub.io; 6 library pub.io;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 controller.addError(e); 765 controller.addError(e);
766 controller.close(); 766 controller.close();
767 }); 767 });
768 return new ByteStream(controller.stream); 768 return new ByteStream(controller.stream);
769 } 769 }
770 770
771 withTempDir((tempDir) { 771 withTempDir((tempDir) {
772 // Create the tar file. 772 // Create the tar file.
773 var tarFile = path.join(tempDir, "intermediate.tar"); 773 var tarFile = path.join(tempDir, "intermediate.tar");
774 var args = ["a", "-w$baseDir", tarFile]; 774 var args = ["a", "-w$baseDir", tarFile];
775 args.addAll(contents.map((entry) => '-i!"$entry"')); 775 args.addAll(contents.map((entry) => '-i!$entry'));
776 776
777 // We're passing 'baseDir' both as '-w' and setting it as the working 777 // We're passing 'baseDir' both as '-w' and setting it as the working
778 // directory explicitly here intentionally. The former ensures that the 778 // directory explicitly here intentionally. The former ensures that the
779 // files added to the archive have the correct relative path in the archive. 779 // files added to the archive have the correct relative path in the archive.
780 // The latter enables relative paths in the "-i" args to be resolved. 780 // The latter enables relative paths in the "-i" args to be resolved.
781 return runProcess(pathTo7zip, args, workingDir: baseDir).then((_) { 781 return runProcess(pathTo7zip, args, workingDir: baseDir).then((_) {
782 // GZIP it. 7zip doesn't support doing both as a single operation. Send 782 // GZIP it. 7zip doesn't support doing both as a single operation. Send
783 // the output to stdout. 783 // the output to stdout.
784 args = ["a", "unused", "-tgzip", "-so", tarFile]; 784 args = ["a", "unused", "-tgzip", "-so", tarFile];
785 return startProcess(pathTo7zip, args); 785 return startProcess(pathTo7zip, args);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 const PubProcessResult(this.stdout, this.stderr, this.exitCode); 818 const PubProcessResult(this.stdout, this.stderr, this.exitCode);
819 819
820 bool get success => exitCode == 0; 820 bool get success => exitCode == 0;
821 } 821 }
822 822
823 /// Gets a [Uri] for [uri], which can either already be one, or be a [String]. 823 /// Gets a [Uri] for [uri], which can either already be one, or be a [String].
824 Uri _getUri(uri) { 824 Uri _getUri(uri) {
825 if (uri is Uri) return uri; 825 if (uri is Uri) return uri;
826 return Uri.parse(uri); 826 return Uri.parse(uri);
827 } 827 }
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