Chromium Code Reviews

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

Issue 14914007: Add a "pub deploy" command. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: sdk/lib/_internal/pub/lib/src/command_lish.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command_lish.dart b/sdk/lib/_internal/pub/lib/src/command_lish.dart
index 44a13ae1c3167562b0baab9817fe101b8f062c66..910845749dec593c8ee5eed1f64227bda156e93a 100644
--- a/sdk/lib/_internal/pub/lib/src/command_lish.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_lish.dart
@@ -125,39 +125,6 @@ class LishCommand extends PubCommand {
});
}
- /// The basenames of files that are automatically excluded from archives.
- final _BLACKLISTED_FILES = const ['pubspec.lock'];
-
- /// The basenames of directories that are automatically excluded from
- /// archives.
- final _BLACKLISTED_DIRS = const ['packages'];
-
- /// Returns a list of files that should be included in the published package.
- /// If this is a Git repository, this will respect .gitignore; otherwise, it
- /// will return all non-hidden files.
- Future<List<String>> get _filesToPublish {
- var rootDir = entrypoint.root.dir;
-
- return git.isInstalled.then((gitInstalled) {
- if (dirExists(path.join(rootDir, '.git')) && gitInstalled) {
- // List all files that aren't gitignored, including those not checked
- // in to Git.
- return git.run(["ls-files", "--cached", "--others",
- "--exclude-standard"]);
- }
-
- return listDir(rootDir, recursive: true)
- .where(fileExists) // Skip directories and broken symlinks.
- .map((entry) => path.relative(entry, from: rootDir));
- }).then((files) => files.where(_shouldPublish).toList());
- }
-
- /// Returns `true` if [file] should be published.
- bool _shouldPublish(String file) {
- if (_BLACKLISTED_FILES.contains(path.basename(file))) return false;
- return !path.split(file).any(_BLACKLISTED_DIRS.contains);
- }
-
/// Returns the value associated with [key] in [map]. Throws a user-friendly
/// error if [map] doens't contain [key].
_expectField(Map map, String key, http.Response response) {

Powered by Google App Engine