Skip to content

Commit

Permalink
fix: GithubPlugin: read correct remote when multiple github repos exist
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen authored and Gerrit0 committed Jun 5, 2020
1 parent 48090b7 commit 30fab7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/converter/plugins/GitHubPlugin.ts
Expand Up @@ -133,13 +133,13 @@ export class Repository {
static tryCreateRepository(path: string, gitRevision: string, gitRemote: string): Repository | undefined {
ShellJS.pushd(path);
const out = <ShellJS.ExecOutputReturnValue> ShellJS.exec('git rev-parse --show-toplevel', {silent: true});
const remotesOutput = <ShellJS.ExecOutputReturnValue> ShellJS.exec(`git remote get-url ${gitRemote}`, {silent: true});
ShellJS.popd();

if (!out || out.code !== 0) {
if (!out || out.code !== 0 || !remotesOutput || remotesOutput.code !== 0) {
return;
}

const remotesOutput = <ShellJS.ExecOutputReturnValue> ShellJS.exec(`git remote get-url ${gitRemote}`, {silent: true});
let remotes: string[] = (remotesOutput.code === 0) ? remotesOutput.stdout.split('\n') : [];

return new Repository(BasePath.normalize(out.stdout.replace('\n', '')), gitRevision, remotes);
Expand Down

0 comments on commit 30fab7a

Please sign in to comment.