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

Unified Diff: utils/pub/io.dart

Issue 11170003: Pub fix for Windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« utils/pub/hosted_source.dart ('K') | « utils/pub/hosted_source.dart ('k') | no next file » | 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 c5f64c6bd0b237dbe0c653bb96c56a3d14890428..ee89eaec33803323b7714f751c47b837cc876166 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -499,50 +499,10 @@ Future<PubProcessResult> runProcess(String executable, List<String> args,
}
options.environment = environment;
- final process = Process.start(executable, args, options);
-
- final outStream = new StringInputStream(process.stdout);
- final processStdout = <String>[];
-
- final errStream = new StringInputStream(process.stderr);
- final processStderr = <String>[];
-
- final completer = new Completer<PubProcessResult>();
-
- checkComplete() {
- // Wait until the process is done and its output streams are closed.
- if (!pipeStdout && !outStream.closed) return;
- if (!pipeStderr && !errStream.closed) return;
- if (exitCode == null) return;
-
- completer.complete(new PubProcessResult(
- processStdout, processStderr, exitCode));
- }
-
- if (pipeStdout) {
- process.stdout.pipe(stdout, close: false);
- } else {
- outStream.onLine = () => processStdout.add(outStream.readLine());
- outStream.onClosed = checkComplete;
- outStream.onError = (error) => completer.completeException(error);
- }
-
- if (pipeStderr) {
- process.stderr.pipe(stderr, close: false);
- } else {
- errStream.onLine = () => processStderr.add(errStream.readLine());
- errStream.onClosed = checkComplete;
- errStream.onError = (error) => completer.completeException(error);
- }
-
- process.onExit = (actualExitCode) {
- exitCode = actualExitCode;
- checkComplete();
- };
-
- process.onError = (error) => completer.completeException(error);
-
- return completer.future;
+ var future = Process.run(executable, args, options);
+ return future.transform((result) {
+ return new PubProcessResult(result.stdout, result.stderr, result.exitCode);
+ });
}
/**
@@ -676,7 +636,7 @@ Future<bool> _extractTarGzWindows(InputStream stream, String destination) {
// Note: This line of code gets munged by create_sdk.py to be the correct
// relative path to 7zip in the SDK.
- var pathTo7zip = '../../third_party/7zip/7za.exe';
+ var pathTo7zip = '7zip/7za.exe';
kasperl 2012/10/16 08:01:27 Have you double checked that this works with creat
Anders Johnsen 2012/10/16 08:03:19 I didn't see this change. Is this intentional?
Johnni Winther 2012/10/16 08:08:01 Removed.
var command = scriptDir.append(pathTo7zip).canonicalize().toNativePath();
var tempDir;
« utils/pub/hosted_source.dart ('K') | « utils/pub/hosted_source.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698