Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions lib/landing_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class LandingSession extends Session {
const shouldContinue = await cli.prompt(
`This PR ${status} to land, do you want to continue?`, { defaultAnswer });
if (!shouldContinue) {
cli.setExitCode(1);
return this.abort(false);
}

Expand All @@ -47,13 +48,19 @@ class LandingSession extends Session {
}

async abort(tryResetBranch = true) {
const { cli } = this;
this.cleanFiles();
if (tryResetBranch) {
await this.tryResetBranch();
try {
const { cli } = this;
this.cleanFiles();
if (tryResetBranch) {
await this.tryResetBranch();
}
cli.ok(`Aborted \`git node land\` session in ${this.ncuDir}`);
} catch (ex) {
const { cli } = this;
cli.setExitCode(1);
cli.error(`Couldn't abort \`git node land\` session in ${this.ncuDir}`);
throw ex;
}
cli.ok(`Aborted \`git node land\` session in ${this.ncuDir}`);
cli.setExitCode(1);
}

async downloadAndPatch() {
Expand Down