Remove unused code

This commit is contained in:
Tonye Jack 2023-05-22 22:17:28 -06:00
parent e04f5bc36a
commit d499479423
3 changed files with 13 additions and 29 deletions

15
dist/index.js generated vendored
View File

@ -1090,7 +1090,7 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.setOutput = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getBranchHeadSha = exports.getParentHeadSha = exports.getHeadSha = exports.gitLog = exports.gitDiff = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.getFilesFromSourceFile = exports.getPatterns = exports.exists = exports.escapeString = exports.verifyMinimumGitVersion = void 0; exports.setOutput = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getBranchHeadSha = exports.getParentHeadSha = exports.getHeadSha = exports.gitLog = exports.gitDiff = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.getFilesFromSourceFile = exports.getPatterns = exports.exists = exports.verifyMinimumGitVersion = void 0;
/*global AsyncIterableIterator*/ /*global AsyncIterableIterator*/
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514)); const exec = __importStar(__nccwpck_require__(1514));
@ -1116,10 +1116,6 @@ const verifyMinimumGitVersion = () => __awaiter(void 0, void 0, void 0, function
} }
}); });
exports.verifyMinimumGitVersion = verifyMinimumGitVersion; exports.verifyMinimumGitVersion = verifyMinimumGitVersion;
function escapeString(value) {
return value.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
}
exports.escapeString = escapeString;
function exists(filePath) { function exists(filePath) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
@ -1357,7 +1353,7 @@ const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule =
.split('\n') .split('\n')
.map(line => { .map(line => {
const [, oldPath, newPath] = line.split('\t'); const [, oldPath, newPath] = line.split('\t');
return `${escapeString(oldPath)}${oldNewSeparator}${escapeString(newPath)}`; return `${oldPath}${oldNewSeparator}${newPath}`;
}); });
}); });
exports.gitRenamedFiles = gitRenamedFiles; exports.gitRenamedFiles = gitRenamedFiles;
@ -1384,16 +1380,13 @@ const gitDiff = ({ cwd, sha1, sha2, diff, diffFilter, filePatterns = [], isSubmo
} }
return []; return [];
} }
return stdout return stdout.split('\n').filter(filePath => {
.split('\n')
.filter(filePath => {
if (filePatterns.length === 0) { if (filePatterns.length === 0) {
return filePath !== ''; return filePath !== '';
} }
const match = patternHelper.match(filePatterns, filePath); const match = patternHelper.match(filePatterns, filePath);
return filePath !== '' && match === internal_match_kind_1.MatchKind.All; return filePath !== '' && match === internal_match_kind_1.MatchKind.All;
}) });
.map(p => escapeString(p));
}); });
exports.gitDiff = gitDiff; exports.gitDiff = gitDiff;
const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () { const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -38,10 +38,6 @@ export const verifyMinimumGitVersion = async (): Promise<void> => {
} }
} }
export function escapeString(value: string): string {
return value.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
}
export async function exists(filePath: string): Promise<boolean> { export async function exists(filePath: string): Promise<boolean> {
try { try {
await fs.access(filePath) await fs.access(filePath)
@ -365,9 +361,7 @@ export const gitRenamedFiles = async ({
.split('\n') .split('\n')
.map(line => { .map(line => {
const [, oldPath, newPath] = line.split('\t') const [, oldPath, newPath] = line.split('\t')
return `${escapeString(oldPath)}${oldNewSeparator}${escapeString( return `${oldPath}${oldNewSeparator}${newPath}`
newPath
)}`
}) })
} }
@ -422,17 +416,14 @@ export const gitDiff = async ({
return [] return []
} }
return stdout return stdout.split('\n').filter(filePath => {
.split('\n') if (filePatterns.length === 0) {
.filter(filePath => { return filePath !== ''
if (filePatterns.length === 0) { }
return filePath !== ''
}
const match = patternHelper.match(filePatterns, filePath) const match = patternHelper.match(filePatterns, filePath)
return filePath !== '' && match === MatchKind.All return filePath !== '' && match === MatchKind.All
}) })
.map(p => escapeString(p))
} }
export const gitLog = async ({ export const gitLog = async ({