Skip to content

Commit 65fe6a8

Browse files
author
Sergey Dolin
authored
Use template literals instead of string concatenation
1 parent 011c443 commit 65fe6a8

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

dist/setup/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6644,15 +6644,14 @@ function cacheDependencies(cache, pythonVersion) {
66446644
});
66456645
}
66466646
function run() {
6647+
var _a;
66476648
return __awaiter(this, void 0, void 0, function* () {
6648-
if (process.env['AGENT_TOOLSDIRECTORY'] !== undefined) {
6649-
core.debug('Python is expected to be installed into AGENT_TOOLSDIRECTORY=' +
6650-
process.env['AGENT_TOOLSDIRECTORY']);
6649+
if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) {
6650+
core.debug(`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`);
66516651
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
66526652
}
66536653
else {
6654-
core.debug('Python is expected to be installed into RUNNER_TOOL_CACHE=' +
6655-
process.env['RUNNER_TOOL_CACHE']);
6654+
core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`);
66566655
}
66576656
try {
66586657
const version = core.getInput('python-version');

src/setup-python.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@ async function cacheDependencies(cache: string, pythonVersion: string) {
2525
}
2626

2727
async function run() {
28-
if (process.env['AGENT_TOOLSDIRECTORY'] !== undefined) {
28+
if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
2929
core.debug(
30-
'Python is expected to be installed into AGENT_TOOLSDIRECTORY=' +
31-
process.env['AGENT_TOOLSDIRECTORY']
30+
`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`
3231
);
3332
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
3433
} else {
3534
core.debug(
36-
'Python is expected to be installed into RUNNER_TOOL_CACHE=' +
37-
process.env['RUNNER_TOOL_CACHE']
35+
`Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`
3836
);
3937
}
4038
try {

0 commit comments

Comments
 (0)