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

Unified Diff: utils/pub/command_lish.dart

Issue 11553043: Make listDir always emit paths within the given directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change. Created 8 years 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 | utils/pub/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/command_lish.dart
diff --git a/utils/pub/command_lish.dart b/utils/pub/command_lish.dart
index b0f8733d73fb9b85bec564cbb219116d85b36227..c322c716ef2581c186376bd4eaa27b7e5a9a6731 100644
--- a/utils/pub/command_lish.dart
+++ b/utils/pub/command_lish.dart
@@ -114,13 +114,6 @@ class LishCommand extends PubCommand {
Future<List<String>> get _filesToPublish {
var rootDir = entrypoint.root.dir;
- // TODO(rnystrom): listDir() returns real file paths after symlinks are
- // resolved. This means if libDir contains a symlink, the resulting paths
- // won't appear to be within it, which confuses relativeTo(). Work around
- // that here by making sure we have the real path to libDir. Remove this
- // when #7346 is fixed.
- rootDir = new File(rootDir).fullPathSync();
-
return Futures.wait([
dirExists(join(rootDir, '.git')),
git.isInstalled
@@ -143,20 +136,7 @@ class LishCommand extends PubCommand {
// Should instead only make these relative right before generating
// the tree display (which is what really needs them to be).
// Make it relative to the package root.
- entry = relativeTo(entry, rootDir);
-
- // TODO(rnystrom): dir.list() will include paths with resolved
- // symlinks. In particular, we'll get paths to symlinked files from
- // "packages" that reach outside of this package. Since the path
- // has already been resolved, we don't even see "packages" in that
- // path anymore.
- // These should not be included in the archive. As a hack, ignore
- // any file whose relative path is backing out of the root
- // directory. Should do something cleaner.
- var parts = path.split(entry);
- if (!parts.isEmpty && parts[0] == '..') return null;
-
- return entry;
+ return relativeTo(entry, rootDir);
});
}));
});
« no previous file with comments | « no previous file | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698