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

Unified Diff: sdk/lib/_internal/pub/lib/src/package.dart

Issue 349503003: Properly return Windows-formatted paths from package.listFiles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/package.dart
diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart
index d899a3e6c5455024f5678986d59261a9bd39efbd..fc2c2b52a9faf83e50aae286286503f597adaaa6 100644
--- a/sdk/lib/_internal/pub/lib/src/package.dart
+++ b/sdk/lib/_internal/pub/lib/src/package.dart
@@ -146,9 +146,13 @@ class Package {
// Git always prints files relative to the repository root, but we want
// them relative to the working directory. It also prints forward slashes
// on Windows which we normalize away for easier testing.
- files = files.map((file) => "$dir${path.separator}$file")
- // Filter out broken symlinks, since git doesn't do so automatically.
- .where((file) => !linkExists(file) || fileExists(file));
+ files = files.map((file) {
+ if (Platform.operatingSystem != 'windows') return "$dir/$file";
+ return "$dir\\${file.replaceAll("/", "\\")}";
+ }).where((file) {
+ // Filter out broken symlinks, since git doesn't do so automatically.
+ return !linkExists(file) || fileExists(file);
Bob Nystrom 2014/06/20 16:01:57 Stat-ing each file twice is likely going to be a p
nweiz 2014/06/23 20:27:54 Actually, just fileExists should work, now that I
+ });
} else {
files = listDir(beneath, recursive: true, includeDirs: false,
whitelist: _WHITELISTED_FILES);
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698