Skip to content

Commit 77eb24d

Browse files
author
Sergey Koryshev
authored
Merge pull request #189 from microsoft/users/sergey.koryshev/4113-refactor-nodejs-downloading
Add subscription on "aborted" event for Node10 compatibility
2 parents e379eeb + 18d6a82 commit 77eb24d

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@
2727

2828
### 2.0.1
2929

30-
- <https://github.com/microsoft/azure-pipelines-tool-lib/pull/184>
30+
- <https://github.com/microsoft/azure-pipelines-tool-lib/pull/184>
31+
32+
### 2.0.3
33+
34+
- <https://github.com/microsoft/azure-pipelines-tool-lib/pull/189>

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "azure-pipelines-tool-lib",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Azure Pipelines Tool Installer Lib for CI/CD Tasks",
55
"main": "tool.js",
66
"scripts": {

tool.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ export async function downloadTool(
258258
file.end();
259259
reject(err);
260260
})
261+
.on('aborted', () => {
262+
// this block is for Node10 compatibility since it doesn't emit 'error' event after 'aborted' one
263+
file.end();
264+
reject(new Error('Aborted'));
265+
})
261266
.pipe(file);
262267
} catch (err) {
263268
reject(err);

0 commit comments

Comments
 (0)