update build

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

20
dist/setup/index.js vendored
View file

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