Unverified Commit 1363489a authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Add a --just-print flag to roll_dev. (#14766)

This will allow other tools to call into the roll_dev script
to know what version is about to be published without actually
publishing.
parent 1e242ebc
......@@ -17,6 +17,7 @@ const String kY = 'y';
const String kZ = 'z';
const String kCommit = 'commit';
const String kOrigin = 'origin';
const String kJustPrint = 'just-print';
const String kYes = 'yes';
const String kHelp = 'help';
......@@ -47,6 +48,13 @@ void main(List<String> args) {
valueHelp: 'repository',
defaultsTo: 'upstream',
);
argParser.addFlag(
kJustPrint,
negatable: false,
help:
'Don\'t actually roll the dev channel; '
'just print the would-be version and quit.',
);
argParser.addFlag(kYes, negatable: false, abbr: 'y', help: 'Skip the confirmation prompt.');
argParser.addFlag(kHelp, negatable: false, help: 'Show this help message.', hide: true);
ArgResults argResults;
......@@ -61,6 +69,7 @@ void main(List<String> args) {
final String level = argResults[kIncrement];
final String commit = argResults[kCommit];
final String origin = argResults[kOrigin];
final bool justPrint = argResults[kJustPrint];
final bool autoApprove = argResults[kYes];
final bool help = argResults[kHelp];
......@@ -122,6 +131,11 @@ void main(List<String> args) {
}
version = parts.join('.');
if (justPrint) {
print(version);
exit(0);
}
final String hash = getGitOutput('rev-parse HEAD', 'Get git hash for $commit');
runGit('tag v$version', 'tag the commit with the version label');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment