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

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

Issue 11567015: Exclude .gitignored files from published package. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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:io'; 7 import 'dart:io';
8 import 'dart:json'; 8 import 'dart:json';
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // won't appear to be within it, which confuses relativeTo(). Work around 142 // won't appear to be within it, which confuses relativeTo(). Work around
143 // that here by making sure we have the real path to libDir. Remove this 143 // that here by making sure we have the real path to libDir. Remove this
144 // when #7346 is fixed. 144 // when #7346 is fixed.
145 rootDir = new File(rootDir).fullPathSync(); 145 rootDir = new File(rootDir).fullPathSync();
146 146
147 return Futures.wait([ 147 return Futures.wait([
148 dirExists(join(rootDir, '.git')), 148 dirExists(join(rootDir, '.git')),
149 git.isInstalled 149 git.isInstalled
150 ]).chain((results) { 150 ]).chain((results) {
151 if (results[0] && results[1]) { 151 if (results[0] && results[1]) {
152 // List all files that aren't gitignored, including those not checked in 152 // List all files that aren't gitignored, including those not checked
153 // to Git. 153 // in to Git.
Siggi Cherem (dart-lang) 2012/12/13 18:34:07 in to => into?
154 return git.run(["ls-files", "--cached", "--others"]); 154 return git.run(["ls-files", "--cached", "--others",
155 "--exclude-standard"]);
155 } 156 }
156 157
157 return listDir(rootDir, recursive: true).chain((entries) { 158 return listDir(rootDir, recursive: true).chain((entries) {
158 return Futures.wait(entries.map((entry) { 159 return Futures.wait(entries.map((entry) {
159 return fileExists(entry).transform((isFile) { 160 return fileExists(entry).transform((isFile) {
160 // Skip directories. 161 // Skip directories.
161 if (!isFile) return null; 162 if (!isFile) return null;
162 163
163 // TODO(rnystrom): Making these relative will break archive 164 // TODO(rnystrom): Making these relative will break archive
164 // creation if the cwd is ever *not* the package root directory. 165 // creation if the cwd is ever *not* the package root directory.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 var s = warnings.length == 1 ? '' : 's'; 238 var s = warnings.length == 1 ? '' : 's';
238 message = "Package has ${warnings.length} warning$s. Upload anyway"; 239 message = "Package has ${warnings.length} warning$s. Upload anyway";
239 } 240 }
240 241
241 return confirm(message).transform((confirmed) { 242 return confirm(message).transform((confirmed) {
242 if (!confirmed) throw "Package upload canceled."; 243 if (!confirmed) throw "Package upload canceled.";
243 }); 244 });
244 }); 245 });
245 } 246 }
246 } 247 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698