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

Unified Diff: utils/pub/command_lish.dart

Issue 12226077: add --preview flag to publish command (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | utils/tests/pub/pub_lish_test.dart » ('j') | utils/tests/pub/pub_lish_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/command_lish.dart
===================================================================
--- utils/pub/command_lish.dart (revision 18263)
+++ utils/pub/command_lish.dart (working copy)
@@ -32,6 +32,8 @@
var parser = new ArgParser();
// TODO(nweiz): Use HostedSource.defaultUrl as the default value once we use
// dart:io for HTTPS requests.
+ parser.addFlag('preview', abbr: 'p', negatable: false,
+ help: 'Preview publishing the package');
nweiz 2013/02/09 00:20:50 Weren't we going to call this --dry-run?
keertip 2013/02/09 00:53:40 Not sure what we settled on in the end, but am OK
nweiz 2013/02/09 00:59:02 I'd prefer --dry-run, since that's consistent with
keertip 2013/02/09 04:05:47 Done.
parser.addOption('server', defaultsTo: 'https://pub.dartlang.org',
help: 'The package server to which to upload this package');
return parser;
@@ -164,6 +166,11 @@
var s = warnings.length == 1 ? '' : 's';
message = "Package has ${warnings.length} warning$s. Upload anyway";
}
+
+ if (commandOptions['preview']){
+ log.warning("Package has ${warnings.length} warnings.");
nweiz 2013/02/09 00:20:50 Nit: it would be nice to do the pluralization tric
keertip 2013/02/09 00:53:40 Done.
+ exit(0);
+ }
nweiz 2013/02/09 00:20:50 Style nit: I'd move this block above the message a
keertip 2013/02/09 00:53:40 Done.
return confirm(message).then((confirmed) {
if (!confirmed) throw "Package upload canceled.";
« no previous file with comments | « no previous file | utils/tests/pub/pub_lish_test.dart » ('j') | utils/tests/pub/pub_lish_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698