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,10 +184,10 @@ export default class Merge extends Command {
await exec( filterCommand, { cwd: cloneDir } ); await exec( filterCommand, { cwd: cloneDir } );
} catch { } catch {
this.error( 'Failed to alter the repository history' ); this.error( 'Failed to alter the repository history' );
} } finally {
CliUx.ux.action.stop(); CliUx.ux.action.stop();
} }
}
/** /**
* Merges the cloned repository into the current one. * Merges the cloned repository into the current one.
@ -207,12 +207,16 @@ export default class Merge extends Command {
try { try {
await exec( 'git remote add ' + source + ' "' + cloneDir + '"' ); await exec( 'git remote add ' + source + ' "' + cloneDir + '"' );
} catch { } catch {
CliUx.ux.action.stop();
this.error( 'Failed to add clone repository as remote' ); this.error( 'Failed to add clone repository as remote' );
} }
try { try {
await exec( 'git fetch ' + source ); await exec( 'git fetch ' + source );
} catch { } catch {
CliUx.ux.action.stop();
this.error( 'Failed to fetch clone repository' ); this.error( 'Failed to fetch clone repository' );
} }
@ -224,6 +228,8 @@ export default class Merge extends Command {
branchToMerge branchToMerge
); );
} catch { } catch {
CliUx.ux.action.stop();
this.error( 'Failed to merge the repositories' ); 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( 'git remote remove ' + source );
await exec( 'rm -rf ' + cloneDir ); await exec( 'rm -rf ' + cloneDir );
} catch { } catch {
CliUx.ux.action.stop();
this.error( 'Failed to remove clone repository remote' ); this.error( 'Failed to remove clone repository remote' );
} }