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

Unified Diff: utils/pub/io.dart

Issue 11414044: Enable CurlClient tests on Windows by bundling curl.exe. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Really fix resource loading 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 side-by-side diff with in-line comments
Download patch
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 3bd88c404df8614f09b529c489b67bdf280df97d..e9c335c716a6bb9f0b1aafc96e3616505246b003 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -365,6 +365,13 @@ String getFullPath(entry) {
.toNativePath();
}
+/// Resolves [path] relative to the location of pub.dart.
+String relativeToPub(String path) {
+ var scriptPath = new File(new Options().script).fullPathSync();
+ var scriptDir = new Path.fromNative(scriptPath).directoryPath;
+ return scriptDir.append(path).canonicalize().toNativePath();
+}
+
// TODO(nweiz): make this configurable
/**
* The amount of time in milliseconds to allow HTTP requests before assuming
@@ -646,14 +653,10 @@ Future<bool> _extractTarGzWindows(InputStream stream, String destination) {
// read from stdin instead of a file. Consider resurrecting that version if
// we can figure out why it fails.
- // Find 7zip.
- var scriptPath = new File(new Options().script).fullPathSync();
- var scriptDir = new Path.fromNative(scriptPath).directoryPath;
-
// 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 command = scriptDir.append(pathTo7zip).canonicalize().toNativePath();
+ var command = relativeToPub(pathTo7zip);
var tempDir;

Powered by Google App Engine
This is Rietveld 408576698