Remove unused code
This commit is contained in:
parent
335c663a08
commit
f018002631
19
dist/index.js
generated
vendored
19
dist/index.js
generated
vendored
@ -83,7 +83,7 @@ const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, shaResult })
|
||||
}));
|
||||
}
|
||||
if (inputs.json) {
|
||||
return (0, utils_1.jsonOutput)({ value: renamedFiles, escape: inputs.escape_json });
|
||||
return (0, utils_1.jsonOutput)({ value: renamedFiles, escape: inputs.escapeJson });
|
||||
}
|
||||
return renamedFiles.join(inputs.oldNewFilesSeparator);
|
||||
});
|
||||
@ -131,7 +131,7 @@ const getDiffFiles = ({ inputs, workingDirectory, hasSubmodule, shaResult, diffF
|
||||
}));
|
||||
}
|
||||
if (inputs.json) {
|
||||
return (0, utils_1.jsonOutput)({ value: files, escape: inputs.escape_json });
|
||||
return (0, utils_1.jsonOutput)({ value: files, escape: inputs.escapeJson });
|
||||
}
|
||||
return files.join(inputs.separator);
|
||||
});
|
||||
@ -633,7 +633,7 @@ const getInputs = () => {
|
||||
required: false
|
||||
});
|
||||
const json = core.getBooleanInput('json', { required: false });
|
||||
const escape_json = core.getBooleanInput('escape_json', { required: false });
|
||||
const escapeJson = core.getBooleanInput('escape_json', { required: false });
|
||||
const fetchDepth = core.getInput('fetch_depth', { required: false });
|
||||
const sinceLastRemoteCommit = core.getBooleanInput('since_last_remote_commit', { required: false });
|
||||
const writeOutputFiles = core.getBooleanInput('write_output_files', {
|
||||
@ -666,7 +666,7 @@ const getInputs = () => {
|
||||
dirNames,
|
||||
dirNamesExcludeRoot,
|
||||
json,
|
||||
escape_json,
|
||||
escapeJson,
|
||||
sinceLastRemoteCommit,
|
||||
writeOutputFiles,
|
||||
outputDir,
|
||||
@ -738,7 +738,7 @@ function run() {
|
||||
var _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const env = (0, env_1.getEnv)();
|
||||
core.debug(`Env: ${JSON.stringify(env, null, 2)}`);
|
||||
core.debug(`Env: ${JSON.stringify(process.env, null, 2)}`);
|
||||
const inputs = (0, inputs_1.getInputs)();
|
||||
core.debug(`Inputs: ${JSON.stringify(inputs, null, 2)}`);
|
||||
yield (0, utils_1.verifyMinimumGitVersion)();
|
||||
@ -1507,13 +1507,8 @@ const getDirnameMaxDepth = ({ pathStr, dirNamesMaxDepth, excludeRoot }) => {
|
||||
};
|
||||
exports.getDirnameMaxDepth = getDirnameMaxDepth;
|
||||
const jsonOutput = ({ value, escape }) => {
|
||||
return JSON.stringify(value, (key, value) => {
|
||||
if (typeof value === 'string') {
|
||||
// if escape is true, escape quotes and backslashes
|
||||
return escape ? value.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : value;
|
||||
}
|
||||
return value;
|
||||
});
|
||||
let result = JSON.stringify(value);
|
||||
return escape ? result.replace(/"/g, '\\"') : result;
|
||||
};
|
||||
exports.jsonOutput = jsonOutput;
|
||||
const getFilePatterns = ({ inputs }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
|
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
@ -14,7 +14,7 @@
|
||||
"lint:fix": "eslint --fix src/**/*.ts",
|
||||
"package": "ncc build lib/main.js --source-map --license licenses.txt",
|
||||
"test": "jest --coverage",
|
||||
"all": "yarn build && yarn format && yarn lint:fix && yarn lint && yarn package && yarn test"
|
||||
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Loading…
x
Reference in New Issue
Block a user