-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
main.ts
27 lines (24 loc) · 884 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import * as path from 'path';
import * as task from 'azure-pipelines-task-lib/task';
import * as tl from 'azure-pipelines-task-lib';
import * as proxyutil from './proxyutil';
import { getPlatform } from './taskutil';
import { usePythonVersion } from './usepythonversion';
(async () => {
try {
task.setResourcePath(path.join(__dirname, 'task.json'));
await usePythonVersion({
version: task.getInput('version', false),
architecture: task.getInput('architecture', true)
},
getPlatform());
// Always set proxy.
const proxy: tl.ProxyConfiguration | null = tl.getHttpProxyConfiguration();
if (proxy) {
proxyutil.setProxy(proxy);
}
task.setResult(task.TaskResult.Succeeded, "");
} catch (error) {
task.setResult(task.TaskResult.Failed, error.message);
}
})();