mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 07:22:14 +00:00
update build
This commit is contained in:
parent
e30cfd08dc
commit
bce43cfdd1
1 changed files with 12 additions and 8 deletions
20
dist/setup/index.js
vendored
20
dist/setup/index.js
vendored
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue