Skip to content

Commit

Permalink
git-node: ask to push commits and copy to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
BridgeAR committed May 30, 2020
1 parent 75abd3a commit 642452c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/landing_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
runAsync, runSync, forceRunAsync
} = require('./run');
const Session = require('./session');
const clipboardy = require('clipboardy');
const {
shortSha
} = require('./utils');
Expand Down Expand Up @@ -256,9 +257,21 @@ class LandingSession extends Session {
}

cli.log('To finish landing:');
cli.log(`1. Run \`git push ${upstream} ${branch}\``);

const shouldPush = await cli.prompt(
`Do you want to push the commits to ${upstream} ${branch}?`
);
if (shouldPush) {
await runAsync('git', ['push', upstream, branch]);
} else {
cli.log(`Run \`git push ${upstream} ${branch}\``);
}

const url = `https://github.com/${owner}/${repo}/pull/${prid}`;
cli.log(`2. Post "Landed in ${willBeLanded}" in ${url}`);

clipboardy.writeSync(`Landed in ${willBeLanded} :tada:`);
cli.log(`Copied "Landed in ${willBeLanded} :tada:" to clipboard`);
cli.log(`Please copy the clipboard to ${url}`);

const shouldClean = await cli.prompt('Clean up generated temporary files?');
if (shouldClean) {
Expand Down

0 comments on commit 642452c

Please sign in to comment.