Skip to content

Commit

Permalink
fix: bug with retrieving submodules (#1169)
Browse files Browse the repository at this point in the history
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
  • Loading branch information
jackton1 and repo-ranger[bot] committed May 25, 2023
1 parent 4e23a96 commit 1c2673b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
7 changes: 5 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,19 @@ export const submoduleExists = async ({
}: {
cwd: string
}): Promise<boolean> => {
const {stdout} = await exec.getExecOutput('git', ['submodule', 'status'], {
cwd,
silent: false
})
const {stdout, exitCode} = await exec.getExecOutput(
'git',
['submodule', 'status'],
{
cwd,
ignoreReturnCode: true,
silent: false
}
)

if (exitCode !== 0) {
return false
}

return stdout.trim() !== ''
}
Expand Down Expand Up @@ -261,8 +270,6 @@ export const getSubmodulePath = async ({
}: {
cwd: string
}): Promise<string[]> => {
// git submodule status | awk '{print $2}'

const {exitCode, stdout, stderr} = await exec.getExecOutput(
'git',
['submodule', 'status'],
Expand Down

0 comments on commit 1c2673b

Please sign in to comment.