mirror of
				https://kkgithub.com/actions/setup-python.git
				synced 2025-11-04 12:44:05 +08:00 
			
		
		
		
	Merge pull request #394 from akv-platform/v-sedoli/set-env-by-default
Assign default value of AGENT_TOOLSDIRECTORY if not set
This commit is contained in:
		
							
								
								
									
										13
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							@ -65287,13 +65287,16 @@ function resolveVersionInput() {
 | 
			
		||||
function run() {
 | 
			
		||||
    var _a;
 | 
			
		||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
			
		||||
        if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) {
 | 
			
		||||
            core.debug(`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`);
 | 
			
		||||
        // According to the README windows binaries do not require to be installed
 | 
			
		||||
        // in the specific location, but Mac and Linux do
 | 
			
		||||
        if (!utils_1.IS_WINDOWS && !((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim())) {
 | 
			
		||||
            if (utils_1.IS_LINUX)
 | 
			
		||||
                process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache';
 | 
			
		||||
            else
 | 
			
		||||
                process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
 | 
			
		||||
            process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`);
 | 
			
		||||
        }
 | 
			
		||||
        core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`);
 | 
			
		||||
        try {
 | 
			
		||||
            const version = resolveVersionInput();
 | 
			
		||||
            if (version) {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user