update build

This commit is contained in:
Andrew DiLosa 2022-05-16 19:50:26 -07:00
parent e30cfd08dc
commit bce43cfdd1

16
dist/setup/index.js vendored
View file

@ -6088,15 +6088,19 @@ function cacheDependencies(cache, pythonVersion) {
}
function resolveVersionInput() {
let version = core.getInput('python-version');
const versionFileInput = core.getInput('python-version-file');
if (versionFileInput) {
const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFileInput);
const versionFile = core.getInput('python-version-file');
if (version && versionFile) {
core.warning('Both python-version and python-version-file inputs are specified, only python-version will be used');
}
if (version) {
return version;
}
const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFile || ".python-version");
if (!fs_1.default.existsSync(versionFilePath)) {
throw new Error(`The specified node version file at: ${versionFilePath} does not exist`);
throw new Error(`The specified python version file at: ${versionFilePath} does not exist`);
}
version = fs_1.default.readFileSync(versionFilePath, 'utf8');
core.info(`Resolved ${versionFileInput} as ${version}`);
}
core.info(`Resolved ${versionFile} as ${version}`);
return version;
}
function run() {