azure-pipelines-task-lib 4.13.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/internal.d.ts +2 -0
- package/internal.js +16 -2
- package/package.json +1 -1
- package/task.js +4 -2
package/internal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import vm = require('./vault');
|
|
2
3
|
/**
|
|
3
4
|
* Hash table of known variable info. The formatted env var name is the lookup key.
|
|
@@ -137,3 +138,4 @@ export declare function _isRooted(p: string): boolean;
|
|
|
137
138
|
export declare function _normalizeSeparators(p: string): string;
|
|
138
139
|
export declare function _exposeProxySettings(): void;
|
|
139
140
|
export declare function _exposeCertSettings(): void;
|
|
141
|
+
export declare function isSigPipeError(e: NodeJS.ErrnoException): e is NodeJS.ErrnoException;
|
package/internal.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a, _b;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._exposeCertSettings = exports._exposeProxySettings = exports._normalizeSeparators = exports._isRooted = exports._getDirectoryName = exports._ensureRooted = exports._isUncPath = exports._loadData = exports._ensurePatternRooted = exports._getFindInfoFromPattern = exports._cloneMatchOptions = exports._legacyFindFiles_convertPatternToRegExp = exports._which = exports._checkPath = exports._exist = exports._debug = exports._error = exports._warning = exports._command = exports._getVariableKey = exports._getVariable = exports._loc = exports._setResourcePath = exports._setErrStream = exports._setStdStream = exports._writeLine = exports._truncateBeforeSensitiveKeyword = exports._endsWith = exports._startsWith = exports.IssueAuditAction = exports.IssueSource = exports._vault = exports._knownVariableMap = void 0;
|
|
4
|
+
exports.isSigPipeError = exports._exposeCertSettings = exports._exposeProxySettings = exports._normalizeSeparators = exports._isRooted = exports._getDirectoryName = exports._ensureRooted = exports._isUncPath = exports._loadData = exports._ensurePatternRooted = exports._getFindInfoFromPattern = exports._cloneMatchOptions = exports._legacyFindFiles_convertPatternToRegExp = exports._which = exports._checkPath = exports._exist = exports._debug = exports._error = exports._warning = exports._command = exports._getVariableKey = exports._getVariable = exports._loc = exports._setResourcePath = exports._setErrStream = exports._setStdStream = exports._writeLine = exports._truncateBeforeSensitiveKeyword = exports._endsWith = exports._startsWith = exports.IssueAuditAction = exports.IssueSource = exports._vault = exports._knownVariableMap = void 0;
|
|
4
5
|
var fs = require("fs");
|
|
5
6
|
var path = require("path");
|
|
6
7
|
var os = require("os");
|
|
@@ -293,8 +294,13 @@ function _error(message, source, auditAction) {
|
|
|
293
294
|
}, message);
|
|
294
295
|
}
|
|
295
296
|
exports._error = _error;
|
|
297
|
+
var debugMode = ((_a = _getVariable('system.debug')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'true';
|
|
298
|
+
var shouldCheckDebugMode = ((_b = _getVariable('DistributedTask.Tasks.Node.SkipDebugLogsWhenDebugModeOff')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'true';
|
|
296
299
|
function _debug(message) {
|
|
297
|
-
|
|
300
|
+
if (!shouldCheckDebugMode
|
|
301
|
+
|| (shouldCheckDebugMode && debugMode)) {
|
|
302
|
+
_command('task.debug', null, message);
|
|
303
|
+
}
|
|
298
304
|
}
|
|
299
305
|
exports._debug = _debug;
|
|
300
306
|
// //-----------------------------------------------------
|
|
@@ -923,3 +929,11 @@ function _exposeTaskLibSecret(keyFile, secret) {
|
|
|
923
929
|
return new Buffer(storageFile).toString('base64') + ':' + new Buffer(encryptedContent).toString('base64');
|
|
924
930
|
}
|
|
925
931
|
}
|
|
932
|
+
function isSigPipeError(e) {
|
|
933
|
+
var _a;
|
|
934
|
+
if (!e || typeof e !== 'object') {
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
return e.code === 'EPIPE' && ((_a = e.syscall) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'WRITE';
|
|
938
|
+
}
|
|
939
|
+
exports.isSigPipeError = isSigPipeError;
|
package/package.json
CHANGED
package/task.js
CHANGED
|
@@ -102,8 +102,10 @@ exports.setSanitizedResult = setSanitizedResult;
|
|
|
102
102
|
// Catching all exceptions
|
|
103
103
|
//
|
|
104
104
|
process.on('uncaughtException', function (err) {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
if (!im.isSigPipeError(err)) {
|
|
106
|
+
setResult(TaskResult.Failed, exports.loc('LIB_UnhandledEx', err.message));
|
|
107
|
+
exports.error(String(err.stack), im.IssueSource.TaskInternal);
|
|
108
|
+
}
|
|
107
109
|
});
|
|
108
110
|
//
|
|
109
111
|
// Catching unhandled rejections from promises and rethrowing them as exceptions
|