Skip to content

Commit

Permalink
add --tag-only to prepare-platform-release-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Jul 23, 2018
1 parent a7a8959 commit cc881c5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/platform-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,13 @@ exports.prepareReleaseBranchCommand = function * () {
executil.reportGitPushResult(repos, [repoBranchName, branchName]);
};

function * tagJs (repo, version, pretend) {
function * tagJs (repo, version, pretend, tagOnly) {

function * execOrPretend (cmd) {
if (pretend) {
print('PRETENDING TO RUN: ' + cmd.join(' '));
} else if (tagOnly && cmd[1] === 'push') {
print('SKIP: ' + cmd.join(' '));
} else {
yield executil.execHelper(cmd);
}
Expand Down Expand Up @@ -313,18 +315,25 @@ exports.tagReleaseBranchCommand = function * (argv) {
desc: 'Don\'t actually run git commands, just print out what would be run.',
type: 'boolean'
})
.options('tag-only', {
desc: 'Don\'t actually push to origin, just print out what would be pushed.',
type: 'boolean'
})
);
var repos = flagutil.computeReposFromFlag(argv.r);
var version = flagutil.validateVersionString(argv.version);
var pretend = argv.pretend;
var branchName = versionutil.getReleaseBranchNameFromVersion(version);
var tagOnly = argv['tag-only'];

// First - perform precondition checks.
yield repoupdate.updateRepos(repos, [], true);

function * execOrPretend (cmd) {
if (pretend) {
print('PRETENDING TO RUN: ' + cmd.join(' '));
} else if (tagOnly && cmd[1] === 'push') {
print('SKIP: ' + cmd.join(' '));
} else {
yield executil.execHelper(cmd);
}
Expand Down Expand Up @@ -356,7 +365,7 @@ exports.tagReleaseBranchCommand = function * (argv) {
} else {
print('Repo ' + repo.repoName + ' is already tagged.');
}
yield tagJs(repo, version, pretend);
yield tagJs(repo, version, pretend, tagOnly);

});
});
Expand Down

0 comments on commit cc881c5

Please sign in to comment.