mirror of
https://github.com/tj-actions/changed-files
synced 2025-03-05 21:06:25 +00:00
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:
parent
4e23a965c8
commit
1c2673b763
3 changed files with 19 additions and 9 deletions
7
dist/index.js
generated
vendored
7
dist/index.js
generated
vendored
|
@ -1351,10 +1351,14 @@ const isRepoShallow = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* (
|
||||||
});
|
});
|
||||||
exports.isRepoShallow = isRepoShallow;
|
exports.isRepoShallow = isRepoShallow;
|
||||||
const submoduleExists = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
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,
|
cwd,
|
||||||
|
ignoreReturnCode: true,
|
||||||
silent: false
|
silent: false
|
||||||
});
|
});
|
||||||
|
if (exitCode !== 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return stdout.trim() !== '';
|
return stdout.trim() !== '';
|
||||||
});
|
});
|
||||||
exports.submoduleExists = submoduleExists;
|
exports.submoduleExists = submoduleExists;
|
||||||
|
@ -1383,7 +1387,6 @@ const normalizePath = (p) => {
|
||||||
return p.replace(/\\/g, '/');
|
return p.replace(/\\/g, '/');
|
||||||
};
|
};
|
||||||
const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
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'], {
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
|
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
19
src/utils.ts
19
src/utils.ts
|
@ -205,10 +205,19 @@ export const submoduleExists = async ({
|
||||||
}: {
|
}: {
|
||||||
cwd: string
|
cwd: string
|
||||||
}): Promise<boolean> => {
|
}): Promise<boolean> => {
|
||||||
const {stdout} = await exec.getExecOutput('git', ['submodule', 'status'], {
|
const {stdout, exitCode} = await exec.getExecOutput(
|
||||||
cwd,
|
'git',
|
||||||
silent: false
|
['submodule', 'status'],
|
||||||
})
|
{
|
||||||
|
cwd,
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
silent: false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (exitCode !== 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return stdout.trim() !== ''
|
return stdout.trim() !== ''
|
||||||
}
|
}
|
||||||
|
@ -261,8 +270,6 @@ export const getSubmodulePath = async ({
|
||||||
}: {
|
}: {
|
||||||
cwd: string
|
cwd: string
|
||||||
}): Promise<string[]> => {
|
}): Promise<string[]> => {
|
||||||
// git submodule status | awk '{print $2}'
|
|
||||||
|
|
||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['submodule', 'status'],
|
['submodule', 'status'],
|
||||||
|
|
Loading…
Add table
Reference in a new issue