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

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

Issue 10399076: Get codebase ready for actually supporting versioning. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 8 years, 7 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 | « utils/pub/git_source.dart ('k') | utils/pub/package.dart » ('j') | 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('pub_io'); 8 #library('pub_io');
9 9
10 #import('dart:io'); 10 #import('dart:io');
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 /** 257 /**
258 * Spawns and runs the process located at [executable], passing in [args]. 258 * Spawns and runs the process located at [executable], passing in [args].
259 * Returns a [Future] that will complete the results of the process after it 259 * Returns a [Future] that will complete the results of the process after it
260 * has ended. 260 * has ended.
261 * 261 *
262 * If [pipeStdout] and/or [pipeStderr] are set, all output from the subprocess's 262 * If [pipeStdout] and/or [pipeStderr] are set, all output from the subprocess's
263 * output streams are sent to the parent process's output streams. Output from 263 * output streams are sent to the parent process's output streams. Output from
264 * piped streams won't be available in the result object. 264 * piped streams won't be available in the result object.
265 */ 265 */
266 Future<PubProcessResult> runProcess(String executable, List<String> args, 266 Future<PubProcessResult> runProcess(String executable, List<String> args,
267 [String workingDir, bool pipeStdout = false, bool pipeStderr = false]) { 267 [workingDir, bool pipeStdout = false, bool pipeStderr = false]) {
268 int exitCode; 268 int exitCode;
269 269
270 final options = new ProcessOptions(); 270 final options = new ProcessOptions();
271 if (workingDir != null) options.workingDirectory = workingDir; 271 if (workingDir != null) {
272 options.workingDirectory = _getDirectory(workingDir).path;
273 }
272 274
273 final process = Process.start(executable, args, options); 275 final process = Process.start(executable, args, options);
274 276
275 final outStream = new StringInputStream(process.stdout); 277 final outStream = new StringInputStream(process.stdout);
276 final processStdout = <String>[]; 278 final processStdout = <String>[];
277 279
278 final errStream = new StringInputStream(process.stderr); 280 final errStream = new StringInputStream(process.stderr);
279 final processStderr = <String>[]; 281 final processStderr = <String>[];
280 282
281 final completer = new Completer<PubProcessResult>(); 283 final completer = new Completer<PubProcessResult>();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 344 }
343 345
344 /** 346 /**
345 * Gets a [Directory] for [entry], which can either already be one, or be a 347 * Gets a [Directory] for [entry], which can either already be one, or be a
346 * [String]. 348 * [String].
347 */ 349 */
348 Directory _getDirectory(entry) { 350 Directory _getDirectory(entry) {
349 if (entry is Directory) return entry; 351 if (entry is Directory) return entry;
350 return new Directory(entry); 352 return new Directory(entry);
351 } 353 }
OLDNEW
« no previous file with comments | « utils/pub/git_source.dart ('k') | utils/pub/package.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698