fix: bug with retrieving submodules (#1169)

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
Tonye Jack
2023-05-25 15:26:13 -06:00
committed by GitHub
parent 4e23a965c8
commit 1c2673b763
3 changed files with 19 additions and 9 deletions

7
dist/index.js generated vendored
View File

@@ -1351,10 +1351,14 @@ const isRepoShallow = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* (
});
exports.isRepoShallow = isRepoShallow;
const submoduleExists = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
const { stdout } = yield exec.getExecOutput('git', ['submodule', 'status'], {
const { stdout, exitCode } = yield exec.getExecOutput('git', ['submodule', 'status'], {
cwd,
ignoreReturnCode: true,
silent: false
});
if (exitCode !== 0) {
return false;
}
return stdout.trim() !== '';
});
exports.submoduleExists = submoduleExists;
@@ -1383,7 +1387,6 @@ const normalizePath = (p) => {
return p.replace(/\\/g, '/');
};
const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
// git submodule status | awk '{print $2}'
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
cwd,
ignoreReturnCode: true,