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

Unified Diff: utils/pub/io.dart

Issue 11312133: Pass absolute path to git (redux). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Jiggle the handle. 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
« no previous file with comments | « utils/pub/git_source.dart ('k') | utils/tests/pub/pub.status » ('j') | 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 cccedfc17b93098bafde5f6847aaa8d9023ba6a5..212a30e85f2fa5e85667f88fbc0ee708f25a49a5 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -373,12 +373,18 @@ Future<File> createPackageSymlink(String name, from, to,
});
}
-/**
- * Given [entry] which may be a [String], [File], or [Directory] relative to
- * the current working directory, returns its full canonicalized path.
- */
-// TODO(rnystrom): Should this be async?
-String getFullPath(entry) => new File(_getPath(entry)).fullPathSync();
+/// Given [entry] which may be a [String], [File], or [Directory] relative to
+/// the current working directory, returns its full canonicalized path.
+String getFullPath(entry) {
+ var path = new Path(_getPath(entry));
+
+ // Don't do anything if it's already absolute.
+ if (path.isAbsolute) return path.toNativePath();
+
+ // Using Path.join here instead of File().fullPathSync() because the former
+ // does not require an actual file to exist at that path.
+ return new Path.fromNative(workingDir).join(path).toNativePath();
+}
// TODO(nweiz): make this configurable
/**
« no previous file with comments | « utils/pub/git_source.dart ('k') | utils/tests/pub/pub.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698