Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use template literals instead of string concatenation
  • Loading branch information
Sergey Dolin authored Feb 21, 2022
commit 65fe6a82c70776c8d39cb6ec21b08db2c4a6fe24
9 changes: 4 additions & 5 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6644,15 +6644,14 @@ function cacheDependencies(cache, pythonVersion) {
});
}
function run() {
var _a;
return __awaiter(this, void 0, void 0, function* () {
if (process.env['AGENT_TOOLSDIRECTORY'] !== undefined) {
core.debug('Python is expected to be installed into AGENT_TOOLSDIRECTORY=' +
process.env['AGENT_TOOLSDIRECTORY']);
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']}`);
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 = core.getInput('python-version');
Expand Down
8 changes: 3 additions & 5 deletions src/setup-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ async function cacheDependencies(cache: string, pythonVersion: string) {
}

async function run() {
if (process.env['AGENT_TOOLSDIRECTORY'] !== undefined) {
if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
core.debug(
'Python is expected to be installed into AGENT_TOOLSDIRECTORY=' +
process.env['AGENT_TOOLSDIRECTORY']
`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`
);
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']
`Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`
);
}
try {
Expand Down