mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +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() {
|
||||
let version = core.getInput('python-version');
|
||||
const versionFileInput = core.getInput('python-version-file');
|
||||
if (versionFileInput) {
|
||||
const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFileInput);
|
||||
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}`);
|
||||
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 python version file at: ${versionFilePath} does not exist`);
|
||||
}
|
||||
version = fs_1.default.readFileSync(versionFilePath, 'utf8');
|
||||
core.info(`Resolved ${versionFile} as ${version}`);
|
||||
return version;
|
||||
}
|
||||
function run() {
|
||||
|
|
Loading…
Add table
Reference in a new issue