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

Side by Side Diff: utils/pub/command_lish.dart

Issue 13132002: Version 0.4.3.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/VERSION ('k') | utils/pub/entrypoint.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library command_lish; 5 library command_lish;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:json'; 9 import 'dart:json';
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return git.isInstalled.then((gitInstalled) { 140 return git.isInstalled.then((gitInstalled) {
141 if (dirExists(path.join(rootDir, '.git')) && gitInstalled) { 141 if (dirExists(path.join(rootDir, '.git')) && gitInstalled) {
142 // List all files that aren't gitignored, including those not checked 142 // List all files that aren't gitignored, including those not checked
143 // in to Git. 143 // in to Git.
144 return git.run(["ls-files", "--cached", "--others", 144 return git.run(["ls-files", "--cached", "--others",
145 "--exclude-standard"]); 145 "--exclude-standard"]);
146 } 146 }
147 147
148 return listDir(rootDir, recursive: true).then((entries) { 148 return listDir(rootDir, recursive: true).then((entries) {
149 return entries 149 return entries
150 .where(fileExists) // Skip directories. 150 .where(fileExists) // Skip directories and broken symlinks.
151 .map((entry) => path.relative(entry, from: rootDir)); 151 .map((entry) => path.relative(entry, from: rootDir));
152 }); 152 });
153 }).then((files) => files.where(_shouldPublish).toList()); 153 }).then((files) => files.where(_shouldPublish).toList());
154 } 154 }
155 155
156 /// Returns `true` if [file] should be published. 156 /// Returns `true` if [file] should be published.
157 bool _shouldPublish(String file) { 157 bool _shouldPublish(String file) {
158 if (_BLACKLISTED_FILES.contains(path.basename(file))) return false; 158 if (_BLACKLISTED_FILES.contains(path.basename(file))) return false;
159 return !path.split(file).any(_BLACKLISTED_DIRS.contains); 159 return !path.split(file).any(_BLACKLISTED_DIRS.contains);
160 } 160 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return confirm(message).then((confirmed) { 199 return confirm(message).then((confirmed) {
200 if (!confirmed) { 200 if (!confirmed) {
201 log.error("Package upload canceled."); 201 log.error("Package upload canceled.");
202 return false; 202 return false;
203 } 203 }
204 return true; 204 return true;
205 }); 205 });
206 }); 206 });
207 } 207 }
208 } 208 }
OLDNEW
« no previous file with comments | « tools/VERSION ('k') | utils/pub/entrypoint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698