1
0
Fork 0
mirror of https://github.com/actions/setup-python.git synced 2024-11-26 02:11:27 +00:00

Use template literals instead of string concatenation

This commit is contained in:
Sergey Dolin 2022-02-21 05:23:19 +00:00 committed by GitHub
parent 011c443f81
commit 65fe6a82c7
2 changed files with 7 additions and 10 deletions

9
dist/setup/index.js vendored
View file

@ -6644,15 +6644,14 @@ function cacheDependencies(cache, pythonVersion) {
}); });
} }
function run() { function run() {
var _a;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (process.env['AGENT_TOOLSDIRECTORY'] !== undefined) { 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=' + core.debug(`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`);
process.env['AGENT_TOOLSDIRECTORY']);
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
} }
else { else {
core.debug('Python is expected to be installed into RUNNER_TOOL_CACHE=' + core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`);
process.env['RUNNER_TOOL_CACHE']);
} }
try { try {
const version = core.getInput('python-version'); const version = core.getInput('python-version');

View file

@ -25,16 +25,14 @@ async function cacheDependencies(cache: string, pythonVersion: string) {
} }
async function run() { async function run() {
if (process.env['AGENT_TOOLSDIRECTORY'] !== undefined) { if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
core.debug( core.debug(
'Python is expected to be installed into AGENT_TOOLSDIRECTORY=' + `Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`
process.env['AGENT_TOOLSDIRECTORY']
); );
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
} else { } else {
core.debug( core.debug(
'Python is expected to be installed into RUNNER_TOOL_CACHE=' + `Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`
process.env['RUNNER_TOOL_CACHE']
); );
} }
try { try {