mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-09 21:02:19 +02:00
Handle each OS in its own way
This commit is contained in:
parent
7199395312
commit
5d9fdcab75
2 changed files with 9 additions and 5 deletions
|
@ -5,7 +5,7 @@ import * as path from 'path';
|
|||
import * as os from 'os';
|
||||
import fs from 'fs';
|
||||
import {getCacheDistributor} from './cache-distributions/cache-factory';
|
||||
import {isCacheFeatureAvailable} from './utils';
|
||||
import {isCacheFeatureAvailable, IS_LINUX, IS_WINDOWS} from './utils';
|
||||
|
||||
function isPyPyVersion(versionSpec: string) {
|
||||
return versionSpec.startsWith('pypy');
|
||||
|
@ -49,8 +49,9 @@ function resolveVersionInput(): string {
|
|||
}
|
||||
|
||||
async function run() {
|
||||
if (!process.env.AGENT_TOOLSDIRECTORY?.trim()) {
|
||||
process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache';
|
||||
if (!IS_WINDOWS && !process.env.AGENT_TOOLSDIRECTORY?.trim()) {
|
||||
if (IS_LINUX) process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache';
|
||||
else process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
|
||||
}
|
||||
core.debug(
|
||||
`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue