Skip to content

Commit 5deee7a

Browse files
committed
feat(git-node): suggest abort previous session
1 parent 5034b4f commit 5deee7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/git/land.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ async function main(state, argv, cli, dir) {
189189
cli.warn(
190190
'Failed to detect previous session. ' +
191191
'please run `git node land --abort`');
192+
process.exitCode ||= 1;
192193
return;
193194
}
194195

@@ -197,8 +198,9 @@ async function main(state, argv, cli, dir) {
197198
cli.warn(
198199
'Previous `git node land` session for ' +
199200
`${session.pullName} in progress.`);
200-
cli.log('run `git node land --abort` before starting a new session');
201-
return;
201+
const response = await cli.prompt('Do you want to abort it?', { defaultAnswer: false });
202+
if (!response) throw new Error('Please run `git node land --abort`');
203+
await session.abort();
202204
}
203205
session = new LandingSession(cli, req, dir, argv);
204206
const metadata = await getMetadata(session.argv, argv.skipRefs, cli);

0 commit comments

Comments
 (0)