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

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

Issue 12253054: Get rid of join() and encapsulate File and Directory in io.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 7 years, 10 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 | « no previous file | 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 /// archives. 129 /// archives.
130 final _BLACKLISTED_DIRS = const ['packages']; 130 final _BLACKLISTED_DIRS = const ['packages'];
131 131
132 /// Returns a list of files that should be included in the published package. 132 /// Returns a list of files that should be included in the published package.
133 /// If this is a Git repository, this will respect .gitignore; otherwise, it 133 /// If this is a Git repository, this will respect .gitignore; otherwise, it
134 /// will return all non-hidden files. 134 /// will return all non-hidden files.
135 Future<List<String>> get _filesToPublish { 135 Future<List<String>> get _filesToPublish {
136 var rootDir = entrypoint.root.dir; 136 var rootDir = entrypoint.root.dir;
137 137
138 return git.isInstalled.then((gitInstalled) { 138 return git.isInstalled.then((gitInstalled) {
139 if (dirExists(join(rootDir, '.git')) && gitInstalled) { 139 if (dirExists(path.join(rootDir, '.git')) && gitInstalled) {
140 // List all files that aren't gitignored, including those not checked 140 // List all files that aren't gitignored, including those not checked
141 // in to Git. 141 // in to Git.
142 return git.run(["ls-files", "--cached", "--others", 142 return git.run(["ls-files", "--cached", "--others",
143 "--exclude-standard"]); 143 "--exclude-standard"]);
144 } 144 }
145 145
146 return listDir(rootDir, recursive: true).then((entries) { 146 return listDir(rootDir, recursive: true).then((entries) {
147 return entries 147 return entries
148 .where(fileExists) // Skip directories. 148 .where(fileExists) // Skip directories.
149 .map((entry) => path.relative(entry, from: rootDir)); 149 .map((entry) => path.relative(entry, from: rootDir));
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 return confirm(message).then((confirmed) { 197 return confirm(message).then((confirmed) {
198 if (!confirmed) { 198 if (!confirmed) {
199 log.error("Package upload canceled."); 199 log.error("Package upload canceled.");
200 return false; 200 return false;
201 } 201 }
202 return true; 202 return true;
203 }); 203 });
204 }); 204 });
205 } 205 }
206 } 206 }
OLDNEW
« no previous file with comments | « no previous file | utils/pub/entrypoint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698