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

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

Issue 21235005: Fix pub serve on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | « no previous file | sdk/lib/_internal/pub/pub.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/pub_package_provider.dart
diff --git a/sdk/lib/_internal/pub/lib/src/pub_package_provider.dart b/sdk/lib/_internal/pub/lib/src/pub_package_provider.dart
index da98c6fddc988e90792ec9d65661dffd31d49087..624312707a55e6eac6fbcc97e7cbbe2461664368 100644
--- a/sdk/lib/_internal/pub/lib/src/pub_package_provider.dart
+++ b/sdk/lib/_internal/pub/lib/src/pub_package_provider.dart
@@ -61,12 +61,18 @@ class PubPackageProvider implements PackageProvider {
var packageDir = _packageDirs[package];
var dir = path.join(packageDir, dirPath);
if (!dirExists(dir)) return;
- var entries = listDir(dir, recursive: true);
- files.addAll(entries
- .where((entry) => !path.split(entry).contains("packages"))
- .where(fileExists)
- .map((entry) => new AssetId(package,
- path.relative(entry, from: packageDir))));
+ for (var entry in listDir(dir, recursive: true)) {
+ // Ignore "packages" symlinks if there.
+ if (path.split(entry).contains("packages")) continue;
+
+ // Skip directories.
+ if (!fileExists(entry)) continue;
+
+ // AssetId paths use "/" on all platforms.
+ var relative = path.relative(entry, from: packageDir);
+ relative = path.toUri(relative).path;
+ files.add(new AssetId(package, relative));
+ }
}
// Expose the "asset" and "lib" directories.
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/pub.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698