Added Better Action Handling To Merge Command

This commit cleans up some of the action stop
handling in the merge command. I was adding
this handling to the issue transfer command and
saw the same mistakes made here.
This commit is contained in:
Christopher Allford 2022-03-17 13:35:30 -07:00
parent 1519eeac81
commit 59fe574947
1 changed files with 10 additions and 2 deletions

View File

@ -184,9 +184,9 @@ export default class Merge extends Command {
await exec( filterCommand, { cwd: cloneDir } );
} catch {
this.error( 'Failed to alter the repository history' );
} finally {
CliUx.ux.action.stop();
}
CliUx.ux.action.stop();
}
/**
@ -207,12 +207,16 @@ export default class Merge extends Command {
try {
await exec( 'git remote add ' + source + ' "' + cloneDir + '"' );
} catch {
CliUx.ux.action.stop();
this.error( 'Failed to add clone repository as remote' );
}
try {
await exec( 'git fetch ' + source );
} catch {
CliUx.ux.action.stop();
this.error( 'Failed to fetch clone repository' );
}
@ -224,6 +228,8 @@ export default class Merge extends Command {
branchToMerge
);
} catch {
CliUx.ux.action.stop();
this.error( 'Failed to merge the repositories' );
}
@ -232,6 +238,8 @@ export default class Merge extends Command {
await exec( 'git remote remove ' + source );
await exec( 'rm -rf ' + cloneDir );
} catch {
CliUx.ux.action.stop();
this.error( 'Failed to remove clone repository remote' );
}