File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -5325,8 +5325,11 @@ function cacheDependencies(cache, pythonVersion) {
5325
5325
function run() {
5326
5326
var _a;
5327
5327
return __awaiter(this, void 0, void 0, function* () {
5328
- if (!((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim())) {
5329
- process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache';
5328
+ if (!utils_1.IS_WINDOWS && !((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim())) {
5329
+ if (utils_1.IS_LINUX)
5330
+ process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache';
5331
+ else
5332
+ process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
5330
5333
}
5331
5334
core.debug(`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`);
5332
5335
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import * as path from 'path';
5
5
import * as os from 'os' ;
6
6
import fs from 'fs' ;
7
7
import { getCacheDistributor } from './cache-distributions/cache-factory' ;
8
- import { isCacheFeatureAvailable } from './utils' ;
8
+ import { isCacheFeatureAvailable , IS_LINUX , IS_WINDOWS } from './utils' ;
9
9
10
10
function isPyPyVersion ( versionSpec : string ) {
11
11
return versionSpec . startsWith ( 'pypy' ) ;
@@ -49,8 +49,9 @@ function resolveVersionInput(): string {
49
49
}
50
50
51
51
async function run ( ) {
52
- if ( ! process . env . AGENT_TOOLSDIRECTORY ?. trim ( ) ) {
53
- process . env [ 'AGENT_TOOLSDIRECTORY' ] = '/opt/hostedtoolcache' ;
52
+ if ( ! IS_WINDOWS && ! process . env . AGENT_TOOLSDIRECTORY ?. trim ( ) ) {
53
+ if ( IS_LINUX ) process . env [ 'AGENT_TOOLSDIRECTORY' ] = '/opt/hostedtoolcache' ;
54
+ else process . env [ 'AGENT_TOOLSDIRECTORY' ] = '/Users/runner/hostedtoolcache' ;
54
55
}
55
56
core . debug (
56
57
`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${ process . env [ 'AGENT_TOOLSDIRECTORY' ] } `
You can’t perform that action at this time.
0 commit comments