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

Unified Diff: utils/pub/command_lish.dart

Issue 11528020: Fix issue 7215 by relativising a path before checking its components. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 aa730658f1e3af914268e315ad7672b82a590fe2..f775b46c58860c778f8b0a55e4a1b65bdf48c0f8 100644
--- a/utils/pub/command_lish.dart
+++ b/utils/pub/command_lish.dart
@@ -17,8 +17,6 @@ import 'oauth2.dart' as oauth2;
import 'pub.dart';
import 'validator.dart';
-// TODO(nweiz): Make "publish" the primary name for this command. See issue
-// 6949.
/// Handles the `lish` and `publish` pub commands.
class LishCommand extends PubCommand {
final description = "Publish the current package to pub.dartlang.org.";
@@ -144,9 +142,8 @@ class LishCommand extends PubCommand {
if (file == null || _BLACKLISTED_FILES.contains(basename(file))) {
return false;
}
- // TODO(nweiz): Since `file` is absolute, this will break if the package
- // itself is in a directory named "packages" (issue 7215).
- return !splitPath(file).some(_BLACKLISTED_DIRECTORIES.contains);
+ return !splitPath(relativeTo(file, rootDir))
+ .some(_BLACKLISTED_DIRECTORIES.contains);
}));
}
« 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