azure-pipelines-task-lib 4.17.0 → 4.17.2

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/task.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateReleaseName = exports.addBuildTag = exports.updateBuildNumber = exports.uploadBuildLog = exports.associateArtifact = exports.uploadArtifact = exports.logIssue = exports.logDetail = exports.setProgress = exports.setEndpoint = exports.addAttachment = exports.uploadSummary = exports.prependPath = exports.uploadFile = exports.CodeCoverageEnabler = exports.CodeCoveragePublisher = exports.TestPublisher = exports.getHttpCertConfiguration = exports.getHttpProxyConfiguration = exports.findMatch = exports.filter = exports.match = exports.tool = exports.execSync = exports.exec = exports.execAsync = exports.rmRF = exports.legacyFindFiles = exports.find = exports.retry = exports.mv = exports.cp = exports.ls = exports.which = exports.resolve = exports.mkdirP = exports.popd = exports.pushd = exports.cd = exports.checkPath = exports.cwd = exports.getAgentMode = exports.getNodeMajorVersion = exports.getPlatform = exports.osType = exports.writeFile = exports.exist = exports.stats = exports.debug = exports.error = exports.warning = exports.command = exports.setTaskVariable = exports.getTaskVariable = exports.getSecureFileTicket = exports.getSecureFileName = exports.getEndpointAuthorization = exports.getEndpointAuthorizationParameterRequired = exports.getEndpointAuthorizationParameter = exports.getEndpointAuthorizationSchemeRequired = exports.getEndpointAuthorizationScheme = exports.getEndpointDataParameterRequired = exports.getEndpointDataParameter = exports.getEndpointUrlRequired = exports.getEndpointUrl = exports.getPathInputRequired = exports.getPathInput = exports.filePathSupplied = exports.getDelimitedInput = exports.getPipelineFeature = exports.getBoolFeatureFlag = exports.getBoolInput = exports.getInputRequired = exports.getInput = exports.setSecret = exports.setVariable = exports.getVariables = exports.assertAgent = exports.getVariable = exports.loc = exports.setResourcePath = exports.setSanitizedResult = exports.setResult = exports.setErrStream = exports.setStdStream = exports.AgentHostedMode = exports.Platform = exports.IssueSource = exports.FieldType = exports.ArtifactType = exports.IssueType = exports.TaskState = exports.TaskResult = void 0;
3
+ exports.getPlatform = exports.osType = exports.writeFile = exports.exist = exports.stats = exports.debug = exports.error = exports.warning = exports.command = exports.setTaskVariable = exports.getTaskVariable = exports.getSecureFileTicket = exports.getSecureFileName = exports.getEndpointAuthorization = exports.getEndpointAuthorizationParameterRequired = exports.getEndpointAuthorizationParameter = exports.getEndpointAuthorizationSchemeRequired = exports.getEndpointAuthorizationScheme = exports.getEndpointDataParameterRequired = exports.getEndpointDataParameter = exports.getEndpointUrlRequired = exports.getEndpointUrl = exports.getPathInputRequired = exports.getPathInput = exports.filePathSupplied = exports.getDelimitedInput = exports.getPipelineFeature = exports.getBoolFeatureFlag = exports.getBoolInput = exports.getInputRequired = exports.getInput = exports.setSecret = exports.setVariable = exports.getVariables = exports.assertAgent = exports.getVariable = exports.loc = exports.setResourcePath = exports.setSanitizedResult = exports.setResult = exports.setErrStream = exports.setStdStream = exports.AgentHostedMode = exports.Platform = exports.IssueSource = exports.FieldType = exports.ArtifactType = exports.IssueType = exports.TaskState = exports.TaskResult = void 0;
4
+ exports.updateReleaseName = exports.addBuildTag = exports.updateBuildNumber = exports.uploadBuildLog = exports.associateArtifact = exports.uploadArtifact = exports.logIssue = exports.logDetail = exports.setProgress = exports.setEndpoint = exports.addAttachment = exports.uploadSummary = exports.prependPath = exports.uploadFile = exports.CodeCoverageEnabler = exports.CodeCoveragePublisher = exports.TestPublisher = exports.getHttpCertConfiguration = exports.getHttpProxyConfiguration = exports.findMatch = exports.filter = exports.match = exports.tool = exports.execSync = exports.exec = exports.execAsync = exports.rmRF = exports.legacyFindFiles = exports.find = exports.retry = exports.mv = exports.cp = exports.ls = exports.which = exports.resolve = exports.mkdirP = exports.popd = exports.pushd = exports.cd = exports.checkPath = exports.cwd = exports.getAgentMode = exports.getNodeMajorVersion = void 0;
4
5
  var shell = require("shelljs");
5
6
  var childProcess = require("child_process");
6
7
  var fs = require("fs");
@@ -65,20 +66,20 @@ var AgentHostedMode;
65
66
  exports.setStdStream = im._setStdStream;
66
67
  exports.setErrStream = im._setErrStream;
67
68
  function setResult(result, message, done) {
68
- exports.debug('task result: ' + TaskResult[result]);
69
+ (0, exports.debug)('task result: ' + TaskResult[result]);
69
70
  // add an error issue
70
71
  if (result == TaskResult.Failed && message) {
71
- exports.error(message, exports.IssueSource.TaskInternal);
72
+ (0, exports.error)(message, exports.IssueSource.TaskInternal);
72
73
  }
73
74
  else if (result == TaskResult.SucceededWithIssues && message) {
74
- exports.warning(message, exports.IssueSource.TaskInternal);
75
+ (0, exports.warning)(message, exports.IssueSource.TaskInternal);
75
76
  }
76
77
  // task.complete
77
78
  var properties = { 'result': TaskResult[result] };
78
79
  if (done) {
79
80
  properties['done'] = 'true';
80
81
  }
81
- exports.command('task.complete', properties, message);
82
+ (0, exports.command)('task.complete', properties, message);
82
83
  }
83
84
  exports.setResult = setResult;
84
85
  /**
@@ -103,8 +104,8 @@ exports.setSanitizedResult = setSanitizedResult;
103
104
  //
104
105
  process.on('uncaughtException', function (err) {
105
106
  if (!im.isSigPipeError(err)) {
106
- setResult(TaskResult.Failed, exports.loc('LIB_UnhandledEx', err.message));
107
- exports.error(String(err.stack), im.IssueSource.TaskInternal);
107
+ setResult(TaskResult.Failed, (0, exports.loc)('LIB_UnhandledEx', err.message));
108
+ (0, exports.error)(String(err.stack), im.IssueSource.TaskInternal);
108
109
  }
109
110
  });
110
111
  //
@@ -139,9 +140,9 @@ function assertAgent(minimum) {
139
140
  if (semver.lt(minimum, '2.104.1')) {
140
141
  throw new Error('assertAgent() requires the parameter to be 2.104.1 or higher');
141
142
  }
142
- var agent = exports.getVariable('Agent.Version');
143
+ var agent = (0, exports.getVariable)('Agent.Version');
143
144
  if (agent && semver.lt(agent, minimum)) {
144
- throw new Error("Agent version " + minimum + " or higher is required");
145
+ throw new Error("Agent version ".concat(minimum, " or higher is required"));
145
146
  }
146
147
  }
147
148
  exports.assertAgent = assertAgent;
@@ -162,7 +163,7 @@ function getVariables() {
162
163
  return Object.keys(im._knownVariableMap)
163
164
  .map(function (key) {
164
165
  var info = im._knownVariableMap[key];
165
- return { name: info.name, value: exports.getVariable(info.name), secret: info.secret };
166
+ return { name: info.name, value: (0, exports.getVariable)(info.name), secret: info.secret };
166
167
  });
167
168
  }
168
169
  exports.getVariables = getVariables;
@@ -185,10 +186,10 @@ function setVariable(name, val, secret, isOutput) {
185
186
  }
186
187
  // store the value
187
188
  var varValue = val || '';
188
- exports.debug('set ' + name + '=' + (secret && varValue ? '********' : varValue));
189
+ (0, exports.debug)('set ' + name + '=' + (secret && varValue ? '********' : varValue));
189
190
  if (secret) {
190
- if (varValue && varValue.match(/\r|\n/) && ("" + process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']).toUpperCase() != 'TRUE') {
191
- throw new Error(exports.loc('LIB_MultilineSecret'));
191
+ if (varValue && varValue.match(/\r|\n/) && "".concat(process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']).toUpperCase() != 'TRUE') {
192
+ throw new Error((0, exports.loc)('LIB_MultilineSecret'));
192
193
  }
193
194
  im._vault.storeSecret('SECRET_' + key, varValue);
194
195
  delete process.env[key];
@@ -199,7 +200,7 @@ function setVariable(name, val, secret, isOutput) {
199
200
  // store the metadata
200
201
  im._knownVariableMap[key] = { name: name, secret: secret };
201
202
  // write the setvariable command
202
- exports.command('task.setvariable', { 'variable': name || '', isOutput: (isOutput || false).toString(), 'issecret': (secret || false).toString() }, varValue);
203
+ (0, exports.command)('task.setvariable', { 'variable': name || '', isOutput: (isOutput || false).toString(), 'issecret': (secret || false).toString() }, varValue);
203
204
  }
204
205
  exports.setVariable = setVariable;
205
206
  /**
@@ -209,10 +210,10 @@ exports.setVariable = setVariable;
209
210
  */
210
211
  function setSecret(val) {
211
212
  if (val) {
212
- if (val.match(/\r|\n/) && ("" + process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']).toUpperCase() !== 'TRUE') {
213
- throw new Error(exports.loc('LIB_MultilineSecret'));
213
+ if (val.match(/\r|\n/) && "".concat(process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']).toUpperCase() !== 'TRUE') {
214
+ throw new Error((0, exports.loc)('LIB_MultilineSecret'));
214
215
  }
215
- exports.command('task.setsecret', {}, val);
216
+ (0, exports.command)('task.setsecret', {}, val);
216
217
  }
217
218
  }
218
219
  exports.setSecret = setSecret;
@@ -227,9 +228,9 @@ exports.setSecret = setSecret;
227
228
  function getInput(name, required) {
228
229
  var inval = im._vault.retrieveSecret('INPUT_' + im._getVariableKey(name));
229
230
  if (required && !inval) {
230
- throw new Error(exports.loc('LIB_InputRequired', name));
231
+ throw new Error((0, exports.loc)('LIB_InputRequired', name));
231
232
  }
232
- exports.debug(name + '=' + inval);
233
+ (0, exports.debug)(name + '=' + inval);
233
234
  return inval;
234
235
  }
235
236
  exports.getInput = getInput;
@@ -269,10 +270,10 @@ function getBoolFeatureFlag(ffName, defaultValue) {
269
270
  if (defaultValue === void 0) { defaultValue = false; }
270
271
  var ffValue = process.env[ffName];
271
272
  if (!ffValue) {
272
- exports.debug("Feature flag " + ffName + " not found. Returning " + defaultValue + " as default.");
273
+ (0, exports.debug)("Feature flag ".concat(ffName, " not found. Returning ").concat(defaultValue, " as default."));
273
274
  return defaultValue;
274
275
  }
275
- exports.debug("Feature flag " + ffName + " = " + ffValue);
276
+ (0, exports.debug)("Feature flag ".concat(ffName, " = ").concat(ffValue));
276
277
  return ffValue.toLowerCase() === "true";
277
278
  }
278
279
  exports.getBoolFeatureFlag = getBoolFeatureFlag;
@@ -283,14 +284,14 @@ exports.getBoolFeatureFlag = getBoolFeatureFlag;
283
284
  * @returns boolean
284
285
  */
285
286
  function getPipelineFeature(featureName) {
286
- var variableName = im._getVariableKey("DistributedTask.Tasks." + featureName);
287
+ var variableName = im._getVariableKey("DistributedTask.Tasks.".concat(featureName));
287
288
  var featureValue = process.env[variableName];
288
289
  if (!featureValue) {
289
- exports.debug("Feature '" + featureName + "' not found. Returning false as default.");
290
+ (0, exports.debug)("Feature '".concat(featureName, "' not found. Returning false as default."));
290
291
  return false;
291
292
  }
292
293
  var boolValue = featureValue.toLowerCase() === "true";
293
- exports.debug("Feature '" + featureName + "' = '" + featureValue + "'. Processed as '" + boolValue + "'.");
294
+ (0, exports.debug)("Feature '".concat(featureName, "' = '").concat(featureValue, "'. Processed as '").concat(boolValue, "'."));
294
295
  return boolValue;
295
296
  }
296
297
  exports.getPipelineFeature = getPipelineFeature;
@@ -332,9 +333,9 @@ exports.getDelimitedInput = getDelimitedInput;
332
333
  function filePathSupplied(name) {
333
334
  // normalize paths
334
335
  var pathValue = this.resolve(this.getPathInput(name) || '');
335
- var repoRoot = this.resolve(exports.getVariable('build.sourcesDirectory') || exports.getVariable('system.defaultWorkingDirectory') || '');
336
+ var repoRoot = this.resolve((0, exports.getVariable)('build.sourcesDirectory') || (0, exports.getVariable)('system.defaultWorkingDirectory') || '');
336
337
  var supplied = pathValue !== repoRoot;
337
- exports.debug(name + 'path supplied :' + supplied);
338
+ (0, exports.debug)(name + 'path supplied :' + supplied);
338
339
  return supplied;
339
340
  }
340
341
  exports.filePathSupplied = filePathSupplied;
@@ -353,7 +354,7 @@ function getPathInput(name, required, check) {
353
354
  var inval = getInput(name, required);
354
355
  if (inval) {
355
356
  if (check) {
356
- exports.checkPath(inval, name);
357
+ (0, exports.checkPath)(inval, name);
357
358
  }
358
359
  }
359
360
  return inval;
@@ -387,9 +388,9 @@ exports.getPathInputRequired = getPathInputRequired;
387
388
  function getEndpointUrl(id, optional) {
388
389
  var urlval = process.env['ENDPOINT_URL_' + id];
389
390
  if (!optional && !urlval) {
390
- throw new Error(exports.loc('LIB_EndpointNotExist', id));
391
+ throw new Error((0, exports.loc)('LIB_EndpointNotExist', id));
391
392
  }
392
- exports.debug(id + '=' + urlval);
393
+ (0, exports.debug)(id + '=' + urlval);
393
394
  return urlval;
394
395
  }
395
396
  exports.getEndpointUrl = getEndpointUrl;
@@ -416,9 +417,9 @@ exports.getEndpointUrlRequired = getEndpointUrlRequired;
416
417
  function getEndpointDataParameter(id, key, optional) {
417
418
  var dataParamVal = process.env['ENDPOINT_DATA_' + id + '_' + key.toUpperCase()];
418
419
  if (!optional && !dataParamVal) {
419
- throw new Error(exports.loc('LIB_EndpointDataNotExist', id, key));
420
+ throw new Error((0, exports.loc)('LIB_EndpointDataNotExist', id, key));
420
421
  }
421
- exports.debug(id + ' data ' + key + ' = ' + dataParamVal);
422
+ (0, exports.debug)(id + ' data ' + key + ' = ' + dataParamVal);
422
423
  return dataParamVal;
423
424
  }
424
425
  exports.getEndpointDataParameter = getEndpointDataParameter;
@@ -445,9 +446,9 @@ exports.getEndpointDataParameterRequired = getEndpointDataParameterRequired;
445
446
  function getEndpointAuthorizationScheme(id, optional) {
446
447
  var authScheme = im._vault.retrieveSecret('ENDPOINT_AUTH_SCHEME_' + id);
447
448
  if (!optional && !authScheme) {
448
- throw new Error(exports.loc('LIB_EndpointAuthNotExist', id));
449
+ throw new Error((0, exports.loc)('LIB_EndpointAuthNotExist', id));
449
450
  }
450
- exports.debug(id + ' auth scheme = ' + authScheme);
451
+ (0, exports.debug)(id + ' auth scheme = ' + authScheme);
451
452
  return authScheme;
452
453
  }
453
454
  exports.getEndpointAuthorizationScheme = getEndpointAuthorizationScheme;
@@ -474,9 +475,9 @@ exports.getEndpointAuthorizationSchemeRequired = getEndpointAuthorizationSchemeR
474
475
  function getEndpointAuthorizationParameter(id, key, optional) {
475
476
  var authParam = im._vault.retrieveSecret('ENDPOINT_AUTH_PARAMETER_' + id + '_' + key.toUpperCase());
476
477
  if (!optional && !authParam) {
477
- throw new Error(exports.loc('LIB_EndpointAuthNotExist', id));
478
+ throw new Error((0, exports.loc)('LIB_EndpointAuthNotExist', id));
478
479
  }
479
- exports.debug(id + ' auth param ' + key + ' = ' + authParam);
480
+ (0, exports.debug)(id + ' auth param ' + key + ' = ' + authParam);
480
481
  return authParam;
481
482
  }
482
483
  exports.getEndpointAuthorizationParameter = getEndpointAuthorizationParameter;
@@ -503,9 +504,9 @@ exports.getEndpointAuthorizationParameterRequired = getEndpointAuthorizationPara
503
504
  function getEndpointAuthorization(id, optional) {
504
505
  var aval = im._vault.retrieveSecret('ENDPOINT_AUTH_' + id);
505
506
  if (!optional && !aval) {
506
- setResult(TaskResult.Failed, exports.loc('LIB_EndpointAuthNotExist', id));
507
+ setResult(TaskResult.Failed, (0, exports.loc)('LIB_EndpointAuthNotExist', id));
507
508
  }
508
- exports.debug(id + ' exists ' + (!!aval));
509
+ (0, exports.debug)(id + ' exists ' + (!!aval));
509
510
  var auth;
510
511
  try {
511
512
  if (aval) {
@@ -513,7 +514,7 @@ function getEndpointAuthorization(id, optional) {
513
514
  }
514
515
  }
515
516
  catch (err) {
516
- throw new Error(exports.loc('LIB_InvalidEndpointAuth', aval));
517
+ throw new Error((0, exports.loc)('LIB_InvalidEndpointAuth', aval));
517
518
  }
518
519
  return auth;
519
520
  }
@@ -529,7 +530,7 @@ exports.getEndpointAuthorization = getEndpointAuthorization;
529
530
  */
530
531
  function getSecureFileName(id) {
531
532
  var name = process.env['SECUREFILE_NAME_' + id];
532
- exports.debug('secure file name for id ' + id + ' = ' + name);
533
+ (0, exports.debug)('secure file name for id ' + id + ' = ' + name);
533
534
  return name;
534
535
  }
535
536
  exports.getSecureFileName = getSecureFileName;
@@ -541,7 +542,7 @@ exports.getSecureFileName = getSecureFileName;
541
542
  */
542
543
  function getSecureFileTicket(id) {
543
544
  var ticket = im._vault.retrieveSecret('SECUREFILE_TICKET_' + id);
544
- exports.debug('secure file ticket for id ' + id + ' = ' + ticket);
545
+ (0, exports.debug)('secure file ticket for id ' + id + ' = ' + ticket);
545
546
  return ticket;
546
547
  }
547
548
  exports.getSecureFileTicket = getSecureFileTicket;
@@ -561,7 +562,7 @@ function getTaskVariable(name) {
561
562
  if (inval) {
562
563
  inval = inval.trim();
563
564
  }
564
- exports.debug('task variable: ' + name + '=' + inval);
565
+ (0, exports.debug)('task variable: ' + name + '=' + inval);
565
566
  return inval;
566
567
  }
567
568
  exports.getTaskVariable = getTaskVariable;
@@ -580,11 +581,11 @@ function setTaskVariable(name, val, secret) {
580
581
  var key = im._getVariableKey(name);
581
582
  // store the value
582
583
  var varValue = val || '';
583
- exports.debug('set task variable: ' + name + '=' + (secret && varValue ? '********' : varValue));
584
+ (0, exports.debug)('set task variable: ' + name + '=' + (secret && varValue ? '********' : varValue));
584
585
  im._vault.storeSecret('VSTS_TASKVARIABLE_' + key, varValue);
585
586
  delete process.env[key];
586
587
  // write the command
587
- exports.command('task.settaskvariable', { 'variable': name || '', 'issecret': (secret || false).toString() }, varValue);
588
+ (0, exports.command)('task.settaskvariable', { 'variable': name || '', 'issecret': (secret || false).toString() }, varValue);
588
589
  }
589
590
  exports.setTaskVariable = setTaskVariable;
590
591
  //-----------------------------------------------------
@@ -600,9 +601,9 @@ exports.debug = im._debug;
600
601
  function _checkShell(cmd, continueOnError) {
601
602
  var se = shell.error();
602
603
  if (se) {
603
- exports.debug(cmd + ' failed');
604
- var errMsg = exports.loc('LIB_OperationFailed', cmd, se);
605
- exports.debug(errMsg);
604
+ (0, exports.debug)(cmd + ' failed');
605
+ var errMsg = (0, exports.loc)('LIB_OperationFailed', cmd, se);
606
+ (0, exports.debug)(errMsg);
606
607
  if (!continueOnError) {
607
608
  throw new Error(errMsg);
608
609
  }
@@ -651,7 +652,7 @@ function getPlatform() {
651
652
  case 'win32': return Platform.Windows;
652
653
  case 'darwin': return Platform.MacOS;
653
654
  case 'linux': return Platform.Linux;
654
- default: throw Error(exports.loc('LIB_PlatformNotSupported', process.platform));
655
+ default: throw Error((0, exports.loc)('LIB_PlatformNotSupported', process.platform));
655
656
  }
656
657
  }
657
658
  exports.getPlatform = getPlatform;
@@ -663,7 +664,7 @@ function getNodeMajorVersion() {
663
664
  var _a;
664
665
  var version = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node;
665
666
  if (!version) {
666
- throw new Error(exports.loc('LIB_UndefinedNodeVersion'));
667
+ throw new Error((0, exports.loc)('LIB_UndefinedNodeVersion'));
667
668
  }
668
669
  var parts = version.split('.').map(Number);
669
670
  if (parts.length < 1) {
@@ -677,7 +678,7 @@ exports.getNodeMajorVersion = getNodeMajorVersion;
677
678
  * @returns {AgentHostedMode}
678
679
  */
679
680
  function getAgentMode() {
680
- var agentCloudId = exports.getVariable('Agent.CloudId');
681
+ var agentCloudId = (0, exports.getVariable)('Agent.CloudId');
681
682
  if (agentCloudId === undefined)
682
683
  return AgentHostedMode.Unknown;
683
684
  if (agentCloudId)
@@ -739,7 +740,7 @@ exports.popd = popd;
739
740
  */
740
741
  function mkdirP(p) {
741
742
  if (!p) {
742
- throw new Error(exports.loc('LIB_ParameterIsRequired', 'p'));
743
+ throw new Error((0, exports.loc)('LIB_ParameterIsRequired', 'p'));
743
744
  }
744
745
  // build a stack of directories to create
745
746
  var stack = [];
@@ -748,11 +749,11 @@ function mkdirP(p) {
748
749
  // validate the loop is not out of control
749
750
  if (stack.length >= Number(process.env['TASKLIB_TEST_MKDIRP_FAILSAFE'] || 1000)) {
750
751
  // let the framework throw
751
- exports.debug('loop is out of control');
752
+ (0, exports.debug)('loop is out of control');
752
753
  fs.mkdirSync(p);
753
754
  return;
754
755
  }
755
- exports.debug("testing directory '" + testDir + "'");
756
+ (0, exports.debug)("testing directory '".concat(testDir, "'"));
756
757
  var stats_1 = void 0;
757
758
  try {
758
759
  stats_1 = fs.statSync(testDir);
@@ -762,7 +763,7 @@ function mkdirP(p) {
762
763
  // validate the directory is not the drive root
763
764
  var parentDir = path.dirname(testDir);
764
765
  if (testDir == parentDir) {
765
- throw new Error(exports.loc('LIB_MkdirFailedInvalidDriveRoot', p, testDir)); // Unable to create directory '{p}'. Root directory does not exist: '{testDir}'
766
+ throw new Error((0, exports.loc)('LIB_MkdirFailedInvalidDriveRoot', p, testDir)); // Unable to create directory '{p}'. Root directory does not exist: '{testDir}'
766
767
  }
767
768
  // push the dir and test the parent
768
769
  stack.push(testDir);
@@ -770,14 +771,14 @@ function mkdirP(p) {
770
771
  continue;
771
772
  }
772
773
  else if (err.code == 'UNKNOWN') {
773
- throw new Error(exports.loc('LIB_MkdirFailedInvalidShare', p, testDir)); // Unable to create directory '{p}'. Unable to verify the directory exists: '{testDir}'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.
774
+ throw new Error((0, exports.loc)('LIB_MkdirFailedInvalidShare', p, testDir)); // Unable to create directory '{p}'. Unable to verify the directory exists: '{testDir}'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.
774
775
  }
775
776
  else {
776
777
  throw err;
777
778
  }
778
779
  }
779
780
  if (!stats_1.isDirectory()) {
780
- throw new Error(exports.loc('LIB_MkdirFailedFileExists', p, testDir)); // Unable to create directory '{p}'. Conflicting file exists: '{testDir}'
781
+ throw new Error((0, exports.loc)('LIB_MkdirFailedFileExists', p, testDir)); // Unable to create directory '{p}'. Conflicting file exists: '{testDir}'
781
782
  }
782
783
  // testDir exists
783
784
  break;
@@ -785,12 +786,12 @@ function mkdirP(p) {
785
786
  // create each directory
786
787
  while (stack.length) {
787
788
  var dir = stack.pop(); // non-null because `stack.length` was truthy
788
- exports.debug("mkdir '" + dir + "'");
789
+ (0, exports.debug)("mkdir '".concat(dir, "'"));
789
790
  try {
790
791
  fs.mkdirSync(dir);
791
792
  }
792
793
  catch (err) {
793
- throw new Error(exports.loc('LIB_MkdirFailed', p, err.message)); // Unable to create directory '{p}'. {err.message}
794
+ throw new Error((0, exports.loc)('LIB_MkdirFailed', p, err.message)); // Unable to create directory '{p}'. {err.message}
794
795
  }
795
796
  }
796
797
  }
@@ -808,7 +809,7 @@ function resolve() {
808
809
  pathSegments[_i] = arguments[_i];
809
810
  }
810
811
  var absolutePath = path.resolve.apply(this, pathSegments);
811
- exports.debug('Absolute path for pathSegments: ' + pathSegments + ' = ' + absolutePath);
812
+ (0, exports.debug)('Absolute path for pathSegments: ' + pathSegments + ' = ' + absolutePath);
812
813
  return absolutePath;
813
814
  }
814
815
  exports.resolve = resolve;
@@ -853,7 +854,7 @@ function cp(source, dest, options, continueOnError, retryCount) {
853
854
  catch (e) {
854
855
  if (retryCount <= 0) {
855
856
  if (continueOnError) {
856
- exports.warning(e, exports.IssueSource.TaskInternal);
857
+ (0, exports.warning)(e, exports.IssueSource.TaskInternal);
857
858
  break;
858
859
  }
859
860
  else {
@@ -861,7 +862,7 @@ function cp(source, dest, options, continueOnError, retryCount) {
861
862
  }
862
863
  }
863
864
  else {
864
- console.log(exports.loc('LIB_CopyFileFailed', retryCount));
865
+ console.log((0, exports.loc)('LIB_CopyFileFailed', retryCount));
865
866
  retryCount--;
866
867
  }
867
868
  }
@@ -903,7 +904,7 @@ function retry(func, args, retryOptions) {
903
904
  catch (e) {
904
905
  if (retryOptions.retryCount <= 0) {
905
906
  if (retryOptions.continueOnError) {
906
- exports.warning(e, exports.IssueSource.TaskInternal);
907
+ (0, exports.warning)(e, exports.IssueSource.TaskInternal);
907
908
  break;
908
909
  }
909
910
  else {
@@ -911,7 +912,7 @@ function retry(func, args, retryOptions) {
911
912
  }
912
913
  }
913
914
  else {
914
- exports.debug("Attempt to execute function \"" + (func === null || func === void 0 ? void 0 : func.name) + "\" failed, retries left: " + retryOptions.retryCount);
915
+ (0, exports.debug)("Attempt to execute function \"".concat(func === null || func === void 0 ? void 0 : func.name, "\" failed, retries left: ").concat(retryOptions.retryCount));
915
916
  retryOptions.retryCount--;
916
917
  }
917
918
  }
@@ -939,7 +940,7 @@ function _getStats(path, followSymbolicLink, allowBrokenSymbolicLinks) {
939
940
  if (err.code == 'ENOENT' && allowBrokenSymbolicLinks) {
940
941
  // fallback to lstat (broken symlinks allowed)
941
942
  stats = fs.lstatSync(path);
942
- exports.debug(" " + path + " (broken symlink)");
943
+ (0, exports.debug)(" ".concat(path, " (broken symlink)"));
943
944
  }
944
945
  else {
945
946
  throw err;
@@ -961,14 +962,14 @@ function _getStats(path, followSymbolicLink, allowBrokenSymbolicLinks) {
961
962
  */
962
963
  function find(findPath, options) {
963
964
  if (!findPath) {
964
- exports.debug('no path specified');
965
+ (0, exports.debug)('no path specified');
965
966
  return [];
966
967
  }
967
968
  // normalize the path, otherwise the first result is inconsistently formatted from the rest of the results
968
969
  // because path.join() performs normalization.
969
970
  findPath = path.normalize(findPath);
970
971
  // debug trace the parameters
971
- exports.debug("findPath: '" + findPath + "'");
972
+ (0, exports.debug)("findPath: '".concat(findPath, "'"));
972
973
  options = options || _getDefaultFindOptions();
973
974
  _debugFindOptions(options);
974
975
  // return empty if not exists
@@ -977,7 +978,7 @@ function find(findPath, options) {
977
978
  }
978
979
  catch (err) {
979
980
  if (err.code == 'ENOENT') {
980
- exports.debug('0 results');
981
+ (0, exports.debug)('0 results');
981
982
  return [];
982
983
  }
983
984
  throw err;
@@ -1003,7 +1004,7 @@ function find(findPath, options) {
1003
1004
  }
1004
1005
  catch (err) {
1005
1006
  if (err.code == 'ENOENT' && options.skipMissingFiles) {
1006
- exports.warning("No such file or directory: \"" + item.path + "\" - skipping.", exports.IssueSource.TaskInternal);
1007
+ (0, exports.warning)("No such file or directory: \"".concat(item.path, "\" - skipping."), exports.IssueSource.TaskInternal);
1007
1008
  return "continue";
1008
1009
  }
1009
1010
  throw err;
@@ -1011,7 +1012,7 @@ function find(findPath, options) {
1011
1012
  result.push(item.path);
1012
1013
  // note, isDirectory() returns false for the lstat of a symlink
1013
1014
  if (stats_2.isDirectory()) {
1014
- exports.debug(" " + item.path + " (directory)");
1015
+ (0, exports.debug)(" ".concat(item.path, " (directory)"));
1015
1016
  if (options.followSymbolicLinks) {
1016
1017
  // get the realpath
1017
1018
  var realPath_1;
@@ -1028,7 +1029,7 @@ function find(findPath, options) {
1028
1029
  }
1029
1030
  // test for a cycle
1030
1031
  if (traversalChain.some(function (x) { return x == realPath_1; })) {
1031
- exports.debug(' cycle detected');
1032
+ (0, exports.debug)(' cycle detected');
1032
1033
  return "continue";
1033
1034
  }
1034
1035
  // update the traversal chain
@@ -1043,17 +1044,17 @@ function find(findPath, options) {
1043
1044
  }
1044
1045
  }
1045
1046
  else {
1046
- exports.debug(" " + item.path + " (file)");
1047
+ (0, exports.debug)(" ".concat(item.path, " (file)"));
1047
1048
  }
1048
1049
  };
1049
1050
  while (stack.length) {
1050
1051
  _loop_1();
1051
1052
  }
1052
- exports.debug(result.length + " results");
1053
+ (0, exports.debug)("".concat(result.length, " results"));
1053
1054
  return result;
1054
1055
  }
1055
1056
  catch (err) {
1056
- throw new Error(exports.loc('LIB_OperationFailed', 'find', err.message));
1057
+ throw new Error((0, exports.loc)('LIB_OperationFailed', 'find', err.message));
1057
1058
  }
1058
1059
  }
1059
1060
  exports.find = find;
@@ -1065,10 +1066,10 @@ var _FindItem = /** @class */ (function () {
1065
1066
  return _FindItem;
1066
1067
  }());
1067
1068
  function _debugFindOptions(options) {
1068
- exports.debug("findOptions.allowBrokenSymbolicLinks: '" + options.allowBrokenSymbolicLinks + "'");
1069
- exports.debug("findOptions.followSpecifiedSymbolicLink: '" + options.followSpecifiedSymbolicLink + "'");
1070
- exports.debug("findOptions.followSymbolicLinks: '" + options.followSymbolicLinks + "'");
1071
- exports.debug("findOptions.skipMissingFiles: '" + options.skipMissingFiles + "'");
1069
+ (0, exports.debug)("findOptions.allowBrokenSymbolicLinks: '".concat(options.allowBrokenSymbolicLinks, "'"));
1070
+ (0, exports.debug)("findOptions.followSpecifiedSymbolicLink: '".concat(options.followSpecifiedSymbolicLink, "'"));
1071
+ (0, exports.debug)("findOptions.followSymbolicLinks: '".concat(options.followSymbolicLinks, "'"));
1072
+ (0, exports.debug)("findOptions.skipMissingFiles: '".concat(options.skipMissingFiles, "'"));
1072
1073
  }
1073
1074
  function _getDefaultFindOptions() {
1074
1075
  return {
@@ -1092,10 +1093,10 @@ function legacyFindFiles(rootDirectory, pattern, includeFiles, includeDirectorie
1092
1093
  if (!pattern) {
1093
1094
  throw new Error('pattern parameter cannot be empty');
1094
1095
  }
1095
- exports.debug("legacyFindFiles rootDirectory: '" + rootDirectory + "'");
1096
- exports.debug("pattern: '" + pattern + "'");
1097
- exports.debug("includeFiles: '" + includeFiles + "'");
1098
- exports.debug("includeDirectories: '" + includeDirectories + "'");
1096
+ (0, exports.debug)("legacyFindFiles rootDirectory: '".concat(rootDirectory, "'"));
1097
+ (0, exports.debug)("pattern: '".concat(pattern, "'"));
1098
+ (0, exports.debug)("includeFiles: '".concat(includeFiles, "'"));
1099
+ (0, exports.debug)("includeDirectories: '".concat(includeDirectories, "'"));
1099
1100
  if (!includeFiles && !includeDirectories) {
1100
1101
  includeFiles = true;
1101
1102
  }
@@ -1126,7 +1127,7 @@ function legacyFindFiles(rootDirectory, pattern, includeFiles, includeDirectorie
1126
1127
  }
1127
1128
  // validate pattern does not end with a slash
1128
1129
  if (im._endsWith(pat, '/') || (process.platform == 'win32' && im._endsWith(pat, '\\'))) {
1129
- throw new Error(exports.loc('LIB_InvalidPattern', pat));
1130
+ throw new Error((0, exports.loc)('LIB_InvalidPattern', pat));
1130
1131
  }
1131
1132
  // root the pattern
1132
1133
  if (rootDirectory && !path.isAbsolute(pat)) {
@@ -1148,27 +1149,27 @@ function legacyFindFiles(rootDirectory, pattern, includeFiles, includeDirectorie
1148
1149
  // find and apply patterns
1149
1150
  var count = 0;
1150
1151
  var result = _legacyFindFiles_getMatchingItems(includePatterns, excludePatterns, !!includeFiles, !!includeDirectories);
1151
- exports.debug('all matches:');
1152
+ (0, exports.debug)('all matches:');
1152
1153
  for (var _b = 0, result_1 = result; _b < result_1.length; _b++) {
1153
1154
  var resultItem = result_1[_b];
1154
- exports.debug(' ' + resultItem);
1155
+ (0, exports.debug)(' ' + resultItem);
1155
1156
  }
1156
- exports.debug('total matched: ' + result.length);
1157
+ (0, exports.debug)('total matched: ' + result.length);
1157
1158
  return result;
1158
1159
  }
1159
1160
  exports.legacyFindFiles = legacyFindFiles;
1160
1161
  function _legacyFindFiles_getMatchingItems(includePatterns, excludePatterns, includeFiles, includeDirectories) {
1161
- exports.debug('getMatchingItems()');
1162
+ (0, exports.debug)('getMatchingItems()');
1162
1163
  for (var _i = 0, includePatterns_1 = includePatterns; _i < includePatterns_1.length; _i++) {
1163
1164
  var pattern = includePatterns_1[_i];
1164
- exports.debug("includePattern: '" + pattern + "'");
1165
+ (0, exports.debug)("includePattern: '".concat(pattern, "'"));
1165
1166
  }
1166
1167
  for (var _a = 0, excludePatterns_1 = excludePatterns; _a < excludePatterns_1.length; _a++) {
1167
1168
  var pattern = excludePatterns_1[_a];
1168
- exports.debug("excludePattern: " + pattern);
1169
+ (0, exports.debug)("excludePattern: ".concat(pattern));
1169
1170
  }
1170
- exports.debug('includeFiles: ' + includeFiles);
1171
- exports.debug('includeDirectories: ' + includeDirectories);
1171
+ (0, exports.debug)('includeFiles: ' + includeFiles);
1172
+ (0, exports.debug)('includeDirectories: ' + includeDirectories);
1172
1173
  var allFiles = {};
1173
1174
  var _loop_2 = function (pattern) {
1174
1175
  // determine the directory to search
@@ -1211,7 +1212,7 @@ function _legacyFindFiles_getMatchingItems(includePatterns, excludePatterns, inc
1211
1212
  var normalizedPath = process.platform == 'win32' ? item.replace(/\\/g, '/') : item; // normalize separators
1212
1213
  // **/times/** will not match C:/fun/times because there isn't a trailing slash
1213
1214
  // so try both if including directories
1214
- var alternatePath = normalizedPath + "/"; // potential bug: it looks like this will result in a false
1215
+ var alternatePath = "".concat(normalizedPath, "/"); // potential bug: it looks like this will result in a false
1215
1216
  // positive if the item is a regular file and not a directory
1216
1217
  var isMatch = false;
1217
1218
  if (patternRegex.test(normalizedPath) || (includeDirectories && patternRegex.test(alternatePath))) {
@@ -1243,25 +1244,25 @@ function _legacyFindFiles_getMatchingItems(includePatterns, excludePatterns, inc
1243
1244
  * @throws when the file or directory exists but could not be deleted.
1244
1245
  */
1245
1246
  function rmRF(inputPath) {
1246
- exports.debug('rm -rf ' + inputPath);
1247
+ (0, exports.debug)('rm -rf ' + inputPath);
1247
1248
  if (getPlatform() == Platform.Windows) {
1248
1249
  // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
1249
1250
  // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
1250
1251
  try {
1251
1252
  if (fs.statSync(inputPath).isDirectory()) {
1252
- exports.debug('removing directory ' + inputPath);
1253
- childProcess.execSync("rd /s /q \"" + inputPath + "\"");
1253
+ (0, exports.debug)('removing directory ' + inputPath);
1254
+ childProcess.execSync("rd /s /q \"".concat(inputPath, "\""));
1254
1255
  }
1255
1256
  else {
1256
- exports.debug('removing file ' + inputPath);
1257
- childProcess.execSync("del /f /a \"" + inputPath + "\"");
1257
+ (0, exports.debug)('removing file ' + inputPath);
1258
+ childProcess.execSync("del /f /a \"".concat(inputPath, "\""));
1258
1259
  }
1259
1260
  }
1260
1261
  catch (err) {
1261
1262
  // if you try to delete a file that doesn't exist, desired result is achieved
1262
1263
  // other errors are valid
1263
1264
  if (err.code != 'ENOENT') {
1264
- throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message));
1265
+ throw new Error((0, exports.loc)('LIB_OperationFailed', 'rmRF', err.message));
1265
1266
  }
1266
1267
  }
1267
1268
  // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
@@ -1272,7 +1273,7 @@ function rmRF(inputPath) {
1272
1273
  // if you try to delete a file that doesn't exist, desired result is achieved
1273
1274
  // other errors are valid
1274
1275
  if (err.code != 'ENOENT') {
1275
- throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message));
1276
+ throw new Error((0, exports.loc)('LIB_OperationFailed', 'rmRF', err.message));
1276
1277
  }
1277
1278
  }
1278
1279
  }
@@ -1289,23 +1290,23 @@ function rmRF(inputPath) {
1289
1290
  if (err.code == 'ENOENT') {
1290
1291
  return;
1291
1292
  }
1292
- throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message));
1293
+ throw new Error((0, exports.loc)('LIB_OperationFailed', 'rmRF', err.message));
1293
1294
  }
1294
1295
  if (lstats.isDirectory()) {
1295
- exports.debug('removing directory');
1296
+ (0, exports.debug)('removing directory');
1296
1297
  shell.rm('-rf', inputPath);
1297
1298
  var errMsg = shell.error();
1298
1299
  if (errMsg) {
1299
- throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', errMsg));
1300
+ throw new Error((0, exports.loc)('LIB_OperationFailed', 'rmRF', errMsg));
1300
1301
  }
1301
1302
  return;
1302
1303
  }
1303
- exports.debug('removing file');
1304
+ (0, exports.debug)('removing file');
1304
1305
  try {
1305
1306
  fs.unlinkSync(inputPath);
1306
1307
  }
1307
1308
  catch (err) {
1308
- throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message));
1309
+ throw new Error((0, exports.loc)('LIB_OperationFailed', 'rmRF', err.message));
1309
1310
  }
1310
1311
  }
1311
1312
  }
@@ -1323,7 +1324,7 @@ exports.rmRF = rmRF;
1323
1324
  function execAsync(tool, args, options) {
1324
1325
  var tr = this.tool(tool);
1325
1326
  tr.on('debug', function (data) {
1326
- exports.debug(data);
1327
+ (0, exports.debug)(data);
1327
1328
  });
1328
1329
  if (args) {
1329
1330
  if (args instanceof Array) {
@@ -1350,7 +1351,7 @@ exports.execAsync = execAsync;
1350
1351
  function exec(tool, args, options) {
1351
1352
  var tr = this.tool(tool);
1352
1353
  tr.on('debug', function (data) {
1353
- exports.debug(data);
1354
+ (0, exports.debug)(data);
1354
1355
  });
1355
1356
  if (args) {
1356
1357
  if (args instanceof Array) {
@@ -1377,7 +1378,7 @@ exports.exec = exec;
1377
1378
  function execSync(tool, args, options) {
1378
1379
  var tr = this.tool(tool);
1379
1380
  tr.on('debug', function (data) {
1380
- exports.debug(data);
1381
+ (0, exports.debug)(data);
1381
1382
  });
1382
1383
  if (args) {
1383
1384
  if (args instanceof Array) {
@@ -1399,7 +1400,7 @@ exports.execSync = execSync;
1399
1400
  function tool(tool) {
1400
1401
  var tr = new trm.ToolRunner(tool);
1401
1402
  tr.on('debug', function (message) {
1402
- exports.debug(message);
1403
+ (0, exports.debug)(message);
1403
1404
  });
1404
1405
  return tr;
1405
1406
  }
@@ -1414,7 +1415,7 @@ exports.tool = tool;
1414
1415
  */
1415
1416
  function match(list, patterns, patternRoot, options) {
1416
1417
  // trace parameters
1417
- exports.debug("patternRoot: '" + patternRoot + "'");
1418
+ (0, exports.debug)("patternRoot: '".concat(patternRoot, "'"));
1418
1419
  options = options || _getDefaultMatchOptions(); // default match options
1419
1420
  _debugMatchOptions(options);
1420
1421
  // convert pattern to an array
@@ -1426,18 +1427,18 @@ function match(list, patterns, patternRoot, options) {
1426
1427
  var originalOptions = options;
1427
1428
  for (var _i = 0, patterns_1 = patterns; _i < patterns_1.length; _i++) {
1428
1429
  var pattern = patterns_1[_i];
1429
- exports.debug("pattern: '" + pattern + "'");
1430
+ (0, exports.debug)("pattern: '".concat(pattern, "'"));
1430
1431
  // trim and skip empty
1431
1432
  pattern = (pattern || '').trim();
1432
1433
  if (!pattern) {
1433
- exports.debug('skipping empty pattern');
1434
+ (0, exports.debug)('skipping empty pattern');
1434
1435
  continue;
1435
1436
  }
1436
1437
  // clone match options
1437
1438
  var options_1 = im._cloneMatchOptions(originalOptions);
1438
1439
  // skip comments
1439
1440
  if (!options_1.nocomment && im._startsWith(pattern, '#')) {
1440
- exports.debug('skipping comment');
1441
+ (0, exports.debug)('skipping comment');
1441
1442
  continue;
1442
1443
  }
1443
1444
  // set nocomment - brace expansion could result in a leading '#'
@@ -1450,7 +1451,7 @@ function match(list, patterns, patternRoot, options) {
1450
1451
  }
1451
1452
  pattern = pattern.substring(negateCount); // trim leading '!'
1452
1453
  if (negateCount) {
1453
- exports.debug("trimmed leading '!'. pattern: '" + pattern + "'");
1454
+ (0, exports.debug)("trimmed leading '!'. pattern: '".concat(pattern, "'"));
1454
1455
  }
1455
1456
  }
1456
1457
  var isIncludePattern = negateCount == 0 ||
@@ -1468,7 +1469,7 @@ function match(list, patterns, patternRoot, options) {
1468
1469
  else {
1469
1470
  // convert slashes on Windows before calling braceExpand(). unfortunately this means braces cannot
1470
1471
  // be escaped on Windows, this limitation is consistent with current limitations of minimatch (3.0.3).
1471
- exports.debug('expanding braces');
1472
+ (0, exports.debug)('expanding braces');
1472
1473
  var convertedPattern = process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern;
1473
1474
  expanded = minimatch.braceExpand(convertedPattern);
1474
1475
  }
@@ -1477,12 +1478,12 @@ function match(list, patterns, patternRoot, options) {
1477
1478
  for (var _a = 0, expanded_1 = expanded; _a < expanded_1.length; _a++) {
1478
1479
  var pattern_1 = expanded_1[_a];
1479
1480
  if (expanded.length != 1 || pattern_1 != preExpanded) {
1480
- exports.debug("pattern: '" + pattern_1 + "'");
1481
+ (0, exports.debug)("pattern: '".concat(pattern_1, "'"));
1481
1482
  }
1482
1483
  // trim and skip empty
1483
1484
  pattern_1 = (pattern_1 || '').trim();
1484
1485
  if (!pattern_1) {
1485
- exports.debug('skipping empty pattern');
1486
+ (0, exports.debug)('skipping empty pattern');
1486
1487
  continue;
1487
1488
  }
1488
1489
  // root the pattern when all of the following conditions are true:
@@ -1491,13 +1492,13 @@ function match(list, patterns, patternRoot, options) {
1491
1492
  // AND matchBase:false or not basename only
1492
1493
  (!options_1.matchBase || (process.platform == 'win32' ? pattern_1.replace(/\\/g, '/') : pattern_1).indexOf('/') >= 0)) {
1493
1494
  pattern_1 = im._ensureRooted(patternRoot, pattern_1);
1494
- exports.debug("rooted pattern: '" + pattern_1 + "'");
1495
+ (0, exports.debug)("rooted pattern: '".concat(pattern_1, "'"));
1495
1496
  }
1496
1497
  if (isIncludePattern) {
1497
1498
  // apply the pattern
1498
- exports.debug('applying include pattern against original list');
1499
+ (0, exports.debug)('applying include pattern against original list');
1499
1500
  var matchResults = minimatch.match(list, pattern_1, options_1);
1500
- exports.debug(matchResults.length + ' matches');
1501
+ (0, exports.debug)(matchResults.length + ' matches');
1501
1502
  // union the results
1502
1503
  for (var _b = 0, matchResults_1 = matchResults; _b < matchResults_1.length; _b++) {
1503
1504
  var matchResult = matchResults_1[_b];
@@ -1506,9 +1507,9 @@ function match(list, patterns, patternRoot, options) {
1506
1507
  }
1507
1508
  else {
1508
1509
  // apply the pattern
1509
- exports.debug('applying exclude pattern against original list');
1510
+ (0, exports.debug)('applying exclude pattern against original list');
1510
1511
  var matchResults = minimatch.match(list, pattern_1, options_1);
1511
- exports.debug(matchResults.length + ' matches');
1512
+ (0, exports.debug)(matchResults.length + ' matches');
1512
1513
  // substract the results
1513
1514
  for (var _c = 0, matchResults_2 = matchResults; _c < matchResults_2.length; _c++) {
1514
1515
  var matchResult = matchResults_2[_c];
@@ -1519,7 +1520,7 @@ function match(list, patterns, patternRoot, options) {
1519
1520
  }
1520
1521
  // return a filtered version of the original list (preserves order and prevents duplication)
1521
1522
  var result = list.filter(function (item) { return map.hasOwnProperty(item); });
1522
- exports.debug(result.length + ' final results');
1523
+ (0, exports.debug)(result.length + ' final results');
1523
1524
  return result;
1524
1525
  }
1525
1526
  exports.match = match;
@@ -1535,17 +1536,17 @@ function filter(pattern, options) {
1535
1536
  }
1536
1537
  exports.filter = filter;
1537
1538
  function _debugMatchOptions(options) {
1538
- exports.debug("matchOptions.debug: '" + options.debug + "'");
1539
- exports.debug("matchOptions.nobrace: '" + options.nobrace + "'");
1540
- exports.debug("matchOptions.noglobstar: '" + options.noglobstar + "'");
1541
- exports.debug("matchOptions.dot: '" + options.dot + "'");
1542
- exports.debug("matchOptions.noext: '" + options.noext + "'");
1543
- exports.debug("matchOptions.nocase: '" + options.nocase + "'");
1544
- exports.debug("matchOptions.nonull: '" + options.nonull + "'");
1545
- exports.debug("matchOptions.matchBase: '" + options.matchBase + "'");
1546
- exports.debug("matchOptions.nocomment: '" + options.nocomment + "'");
1547
- exports.debug("matchOptions.nonegate: '" + options.nonegate + "'");
1548
- exports.debug("matchOptions.flipNegate: '" + options.flipNegate + "'");
1539
+ (0, exports.debug)("matchOptions.debug: '".concat(options.debug, "'"));
1540
+ (0, exports.debug)("matchOptions.nobrace: '".concat(options.nobrace, "'"));
1541
+ (0, exports.debug)("matchOptions.noglobstar: '".concat(options.noglobstar, "'"));
1542
+ (0, exports.debug)("matchOptions.dot: '".concat(options.dot, "'"));
1543
+ (0, exports.debug)("matchOptions.noext: '".concat(options.noext, "'"));
1544
+ (0, exports.debug)("matchOptions.nocase: '".concat(options.nocase, "'"));
1545
+ (0, exports.debug)("matchOptions.nonull: '".concat(options.nonull, "'"));
1546
+ (0, exports.debug)("matchOptions.matchBase: '".concat(options.matchBase, "'"));
1547
+ (0, exports.debug)("matchOptions.nocomment: '".concat(options.nocomment, "'"));
1548
+ (0, exports.debug)("matchOptions.nonegate: '".concat(options.nonegate, "'"));
1549
+ (0, exports.debug)("matchOptions.flipNegate: '".concat(options.flipNegate, "'"));
1549
1550
  }
1550
1551
  function _getDefaultMatchOptions() {
1551
1552
  return {
@@ -1576,7 +1577,7 @@ function _getDefaultMatchOptions() {
1576
1577
  function findMatch(defaultRoot, patterns, findOptions, matchOptions) {
1577
1578
  // apply defaults for parameters and trace
1578
1579
  defaultRoot = defaultRoot || this.getVariable('system.defaultWorkingDirectory') || process.cwd();
1579
- exports.debug("defaultRoot: '" + defaultRoot + "'");
1580
+ (0, exports.debug)("defaultRoot: '".concat(defaultRoot, "'"));
1580
1581
  patterns = patterns || [];
1581
1582
  patterns = typeof patterns == 'string' ? [patterns] : patterns;
1582
1583
  findOptions = findOptions || _getDefaultFindOptions();
@@ -1589,18 +1590,18 @@ function findMatch(defaultRoot, patterns, findOptions, matchOptions) {
1589
1590
  var originalMatchOptions = matchOptions;
1590
1591
  for (var _i = 0, _a = (patterns || []); _i < _a.length; _i++) {
1591
1592
  var pattern = _a[_i];
1592
- exports.debug("pattern: '" + pattern + "'");
1593
+ (0, exports.debug)("pattern: '".concat(pattern, "'"));
1593
1594
  // trim and skip empty
1594
1595
  pattern = (pattern || '').trim();
1595
1596
  if (!pattern) {
1596
- exports.debug('skipping empty pattern');
1597
+ (0, exports.debug)('skipping empty pattern');
1597
1598
  continue;
1598
1599
  }
1599
1600
  // clone match options
1600
1601
  var matchOptions_1 = im._cloneMatchOptions(originalMatchOptions);
1601
1602
  // skip comments
1602
1603
  if (!matchOptions_1.nocomment && im._startsWith(pattern, '#')) {
1603
- exports.debug('skipping comment');
1604
+ (0, exports.debug)('skipping comment');
1604
1605
  continue;
1605
1606
  }
1606
1607
  // set nocomment - brace expansion could result in a leading '#'
@@ -1613,7 +1614,7 @@ function findMatch(defaultRoot, patterns, findOptions, matchOptions) {
1613
1614
  }
1614
1615
  pattern = pattern.substring(negateCount); // trim leading '!'
1615
1616
  if (negateCount) {
1616
- exports.debug("trimmed leading '!'. pattern: '" + pattern + "'");
1617
+ (0, exports.debug)("trimmed leading '!'. pattern: '".concat(pattern, "'"));
1617
1618
  }
1618
1619
  }
1619
1620
  var isIncludePattern = negateCount == 0 ||
@@ -1631,7 +1632,7 @@ function findMatch(defaultRoot, patterns, findOptions, matchOptions) {
1631
1632
  else {
1632
1633
  // convert slashes on Windows before calling braceExpand(). unfortunately this means braces cannot
1633
1634
  // be escaped on Windows, this limitation is consistent with current limitations of minimatch (3.0.3).
1634
- exports.debug('expanding braces');
1635
+ (0, exports.debug)('expanding braces');
1635
1636
  var convertedPattern = process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern;
1636
1637
  expanded = minimatch.braceExpand(convertedPattern);
1637
1638
  }
@@ -1640,25 +1641,25 @@ function findMatch(defaultRoot, patterns, findOptions, matchOptions) {
1640
1641
  for (var _b = 0, expanded_2 = expanded; _b < expanded_2.length; _b++) {
1641
1642
  var pattern_2 = expanded_2[_b];
1642
1643
  if (expanded.length != 1 || pattern_2 != preExpanded) {
1643
- exports.debug("pattern: '" + pattern_2 + "'");
1644
+ (0, exports.debug)("pattern: '".concat(pattern_2, "'"));
1644
1645
  }
1645
1646
  // trim and skip empty
1646
1647
  pattern_2 = (pattern_2 || '').trim();
1647
1648
  if (!pattern_2) {
1648
- exports.debug('skipping empty pattern');
1649
+ (0, exports.debug)('skipping empty pattern');
1649
1650
  continue;
1650
1651
  }
1651
1652
  if (isIncludePattern) {
1652
1653
  // determine the findPath
1653
1654
  var findInfo = im._getFindInfoFromPattern(defaultRoot, pattern_2, matchOptions_1);
1654
1655
  var findPath = findInfo.findPath;
1655
- exports.debug("findPath: '" + findPath + "'");
1656
+ (0, exports.debug)("findPath: '".concat(findPath, "'"));
1656
1657
  if (!findPath) {
1657
- exports.debug('skipping empty path');
1658
+ (0, exports.debug)('skipping empty path');
1658
1659
  continue;
1659
1660
  }
1660
1661
  // perform the find
1661
- exports.debug("statOnly: '" + findInfo.statOnly + "'");
1662
+ (0, exports.debug)("statOnly: '".concat(findInfo.statOnly, "'"));
1662
1663
  var findResults = [];
1663
1664
  if (findInfo.statOnly) {
1664
1665
  // simply stat the path - all path segments were used to build the path
@@ -1670,21 +1671,21 @@ function findMatch(defaultRoot, patterns, findOptions, matchOptions) {
1670
1671
  if (err.code != 'ENOENT') {
1671
1672
  throw err;
1672
1673
  }
1673
- exports.debug('ENOENT');
1674
+ (0, exports.debug)('ENOENT');
1674
1675
  }
1675
1676
  }
1676
1677
  else {
1677
1678
  findResults = find(findPath, findOptions);
1678
1679
  }
1679
- exports.debug("found " + findResults.length + " paths");
1680
+ (0, exports.debug)("found ".concat(findResults.length, " paths"));
1680
1681
  // apply the pattern
1681
- exports.debug('applying include pattern');
1682
+ (0, exports.debug)('applying include pattern');
1682
1683
  if (findInfo.adjustedPattern != pattern_2) {
1683
- exports.debug("adjustedPattern: '" + findInfo.adjustedPattern + "'");
1684
+ (0, exports.debug)("adjustedPattern: '".concat(findInfo.adjustedPattern, "'"));
1684
1685
  pattern_2 = findInfo.adjustedPattern;
1685
1686
  }
1686
1687
  var matchResults = minimatch.match(findResults, pattern_2, matchOptions_1);
1687
- exports.debug(matchResults.length + ' matches');
1688
+ (0, exports.debug)(matchResults.length + ' matches');
1688
1689
  // union the results
1689
1690
  for (var _c = 0, matchResults_3 = matchResults; _c < matchResults_3.length; _c++) {
1690
1691
  var matchResult = matchResults_3[_c];
@@ -1698,17 +1699,17 @@ function findMatch(defaultRoot, patterns, findOptions, matchOptions) {
1698
1699
  !im._isRooted(pattern_2) &&
1699
1700
  (process.platform == 'win32' ? pattern_2.replace(/\\/g, '/') : pattern_2).indexOf('/') < 0) {
1700
1701
  // do not root the pattern
1701
- exports.debug('matchBase and basename only');
1702
+ (0, exports.debug)('matchBase and basename only');
1702
1703
  }
1703
1704
  else {
1704
1705
  // root the exclude pattern
1705
1706
  pattern_2 = im._ensurePatternRooted(defaultRoot, pattern_2);
1706
- exports.debug("after ensurePatternRooted, pattern: '" + pattern_2 + "'");
1707
+ (0, exports.debug)("after ensurePatternRooted, pattern: '".concat(pattern_2, "'"));
1707
1708
  }
1708
1709
  // apply the pattern
1709
- exports.debug('applying exclude pattern');
1710
+ (0, exports.debug)('applying exclude pattern');
1710
1711
  var matchResults = minimatch.match(Object.keys(results).map(function (key) { return results[key]; }), pattern_2, matchOptions_1);
1711
- exports.debug(matchResults.length + ' matches');
1712
+ (0, exports.debug)(matchResults.length + ' matches');
1712
1713
  // substract the results
1713
1714
  for (var _d = 0, matchResults_4 = matchResults; _d < matchResults_4.length; _d++) {
1714
1715
  var matchResult = matchResults_4[_d];
@@ -1721,7 +1722,7 @@ function findMatch(defaultRoot, patterns, findOptions, matchOptions) {
1721
1722
  var finalResult = Object.keys(results)
1722
1723
  .map(function (key) { return results[key]; })
1723
1724
  .sort();
1724
- exports.debug(finalResult.length + ' final results');
1725
+ (0, exports.debug)(finalResult.length + ' final results');
1725
1726
  return finalResult;
1726
1727
  }
1727
1728
  exports.findMatch = findMatch;
@@ -1734,9 +1735,9 @@ exports.findMatch = findMatch;
1734
1735
  */
1735
1736
  function getProxyFormattedUrl(proxyUrl, proxyUsername, proxyPassword) {
1736
1737
  var parsedUrl = new URL(proxyUrl);
1737
- var proxyAddress = parsedUrl.protocol + "//" + parsedUrl.host;
1738
+ var proxyAddress = "".concat(parsedUrl.protocol, "//").concat(parsedUrl.host);
1738
1739
  if (proxyUsername) {
1739
- proxyAddress = parsedUrl.protocol + "//" + proxyUsername + ":" + proxyPassword + "@" + parsedUrl.host;
1740
+ proxyAddress = "".concat(parsedUrl.protocol, "//").concat(proxyUsername, ":").concat(proxyPassword, "@").concat(parsedUrl.host);
1740
1741
  }
1741
1742
  return proxyAddress;
1742
1743
  }
@@ -1746,11 +1747,11 @@ function getProxyFormattedUrl(proxyUrl, proxyUsername, proxyPassword) {
1746
1747
  * @return ProxyConfiguration
1747
1748
  */
1748
1749
  function getHttpProxyConfiguration(requestUrl) {
1749
- var proxyUrl = exports.getVariable('Agent.ProxyUrl');
1750
+ var proxyUrl = (0, exports.getVariable)('Agent.ProxyUrl');
1750
1751
  if (proxyUrl && proxyUrl.length > 0) {
1751
- var proxyUsername = exports.getVariable('Agent.ProxyUsername');
1752
- var proxyPassword = exports.getVariable('Agent.ProxyPassword');
1753
- var proxyBypassHosts = JSON.parse(exports.getVariable('Agent.ProxyBypassList') || '[]');
1752
+ var proxyUsername = (0, exports.getVariable)('Agent.ProxyUsername');
1753
+ var proxyPassword = (0, exports.getVariable)('Agent.ProxyPassword');
1754
+ var proxyBypassHosts = JSON.parse((0, exports.getVariable)('Agent.ProxyBypassList') || '[]');
1754
1755
  var bypass_1 = false;
1755
1756
  if (requestUrl) {
1756
1757
  proxyBypassHosts.forEach(function (bypassHost) {
@@ -1784,16 +1785,16 @@ exports.getHttpProxyConfiguration = getHttpProxyConfiguration;
1784
1785
  * @return CertConfiguration
1785
1786
  */
1786
1787
  function getHttpCertConfiguration() {
1787
- var ca = exports.getVariable('Agent.CAInfo');
1788
- var clientCert = exports.getVariable('Agent.ClientCert');
1788
+ var ca = (0, exports.getVariable)('Agent.CAInfo');
1789
+ var clientCert = (0, exports.getVariable)('Agent.ClientCert');
1789
1790
  if (ca || clientCert) {
1790
1791
  var certConfig = {};
1791
1792
  certConfig.caFile = ca;
1792
1793
  certConfig.certFile = clientCert;
1793
1794
  if (clientCert) {
1794
- var clientCertKey = exports.getVariable('Agent.ClientCertKey');
1795
- var clientCertArchive = exports.getVariable('Agent.ClientCertArchive');
1796
- var clientCertPassword = exports.getVariable('Agent.ClientCertPassword');
1795
+ var clientCertKey = (0, exports.getVariable)('Agent.ClientCertKey');
1796
+ var clientCertArchive = (0, exports.getVariable)('Agent.ClientCertArchive');
1797
+ var clientCertPassword = (0, exports.getVariable)('Agent.ClientCertPassword');
1797
1798
  certConfig.keyFile = clientCertKey;
1798
1799
  certConfig.certArchiveFile = clientCertArchive;
1799
1800
  certConfig.passphrase = clientCertPassword;
@@ -1837,7 +1838,7 @@ var TestPublisher = /** @class */ (function () {
1837
1838
  properties['resultFiles'] = Array.isArray(resultFiles) ? resultFiles.join() : resultFiles;
1838
1839
  }
1839
1840
  properties['testRunSystem'] = testRunSystem;
1840
- exports.command('results.publish', properties, '');
1841
+ (0, exports.command)('results.publish', properties, '');
1841
1842
  };
1842
1843
  return TestPublisher;
1843
1844
  }());
@@ -1862,7 +1863,7 @@ var CodeCoveragePublisher = /** @class */ (function () {
1862
1863
  if (additionalCodeCoverageFiles) {
1863
1864
  properties['additionalcodecoveragefiles'] = Array.isArray(additionalCodeCoverageFiles) ? additionalCodeCoverageFiles.join() : additionalCodeCoverageFiles;
1864
1865
  }
1865
- exports.command('codecoverage.publish', properties, "");
1866
+ (0, exports.command)('codecoverage.publish', properties, "");
1866
1867
  };
1867
1868
  return CodeCoveragePublisher;
1868
1869
  }());
@@ -1878,7 +1879,7 @@ var CodeCoverageEnabler = /** @class */ (function () {
1878
1879
  CodeCoverageEnabler.prototype.enableCodeCoverage = function (buildProps) {
1879
1880
  buildProps['buildtool'] = this.buildTool;
1880
1881
  buildProps['codecoveragetool'] = this.ccTool;
1881
- exports.command('codecoverage.enable', buildProps, "");
1882
+ (0, exports.command)('codecoverage.enable', buildProps, "");
1882
1883
  };
1883
1884
  return CodeCoverageEnabler;
1884
1885
  }());
@@ -1896,7 +1897,7 @@ exports.CodeCoverageEnabler = CodeCoverageEnabler;
1896
1897
  * @returns void
1897
1898
  */
1898
1899
  function uploadFile(path) {
1899
- exports.command("task.uploadfile", null, path);
1900
+ (0, exports.command)("task.uploadfile", null, path);
1900
1901
  }
1901
1902
  exports.uploadFile = uploadFile;
1902
1903
  /**
@@ -1909,7 +1910,7 @@ exports.uploadFile = uploadFile;
1909
1910
  */
1910
1911
  function prependPath(path) {
1911
1912
  assertAgent("2.115.0");
1912
- exports.command("task.prependpath", null, path);
1913
+ (0, exports.command)("task.prependpath", null, path);
1913
1914
  }
1914
1915
  exports.prependPath = prependPath;
1915
1916
  /**
@@ -1921,7 +1922,7 @@ exports.prependPath = prependPath;
1921
1922
  * @returns void
1922
1923
  */
1923
1924
  function uploadSummary(path) {
1924
- exports.command("task.uploadsummary", null, path);
1925
+ (0, exports.command)("task.uploadsummary", null, path);
1925
1926
  }
1926
1927
  exports.uploadSummary = uploadSummary;
1927
1928
  /**
@@ -1935,7 +1936,7 @@ exports.uploadSummary = uploadSummary;
1935
1936
  * @returns void
1936
1937
  */
1937
1938
  function addAttachment(type, name, path) {
1938
- exports.command("task.addattachment", { "type": type, "name": name }, path);
1939
+ (0, exports.command)("task.addattachment", { "type": type, "name": name }, path);
1939
1940
  }
1940
1941
  exports.addAttachment = addAttachment;
1941
1942
  /**
@@ -1950,7 +1951,7 @@ exports.addAttachment = addAttachment;
1950
1951
  * @returns void
1951
1952
  */
1952
1953
  function setEndpoint(id, field, key, value) {
1953
- exports.command("task.setendpoint", { "id": id, "field": FieldType[field].toLowerCase(), "key": key }, value);
1954
+ (0, exports.command)("task.setendpoint", { "id": id, "field": FieldType[field].toLowerCase(), "key": key }, value);
1954
1955
  }
1955
1956
  exports.setEndpoint = setEndpoint;
1956
1957
  /**
@@ -1961,7 +1962,7 @@ exports.setEndpoint = setEndpoint;
1961
1962
  * @returns void
1962
1963
  */
1963
1964
  function setProgress(percent, currentOperation) {
1964
- exports.command("task.setprogress", { "value": "" + percent }, currentOperation);
1965
+ (0, exports.command)("task.setprogress", { "value": "".concat(percent) }, currentOperation);
1965
1966
  }
1966
1967
  exports.setProgress = setProgress;
1967
1968
  /**
@@ -1993,7 +1994,7 @@ function logDetail(id, message, parentId, recordType, recordName, order, startTi
1993
1994
  "state": state ? TaskState[state] : undefined,
1994
1995
  "result": result ? TaskResult[result] : undefined
1995
1996
  };
1996
- exports.command("task.logdetail", properties, message);
1997
+ (0, exports.command)("task.logdetail", properties, message);
1997
1998
  }
1998
1999
  exports.logDetail = logDetail;
1999
2000
  /**
@@ -2015,7 +2016,7 @@ function logIssue(type, message, sourcePath, lineNumber, columnNumber, errorCode
2015
2016
  "linenumber": lineNumber ? lineNumber.toString() : undefined,
2016
2017
  "columnnumber": columnNumber ? columnNumber.toString() : undefined,
2017
2018
  };
2018
- exports.command("task.logissue", properties, message);
2019
+ (0, exports.command)("task.logissue", properties, message);
2019
2020
  }
2020
2021
  exports.logIssue = logIssue;
2021
2022
  //-----------------------------------------------------
@@ -2033,7 +2034,7 @@ exports.logIssue = logIssue;
2033
2034
  * @returns void
2034
2035
  */
2035
2036
  function uploadArtifact(containerFolder, path, name) {
2036
- exports.command("artifact.upload", { "containerfolder": containerFolder, "artifactname": name }, path);
2037
+ (0, exports.command)("artifact.upload", { "containerfolder": containerFolder, "artifactname": name }, path);
2037
2038
  }
2038
2039
  exports.uploadArtifact = uploadArtifact;
2039
2040
  /**
@@ -2048,7 +2049,7 @@ exports.uploadArtifact = uploadArtifact;
2048
2049
  * @returns void
2049
2050
  */
2050
2051
  function associateArtifact(name, path, artifactType) {
2051
- exports.command("artifact.associate", { "type": ArtifactType[artifactType].toLowerCase(), "artifactname": name }, path);
2052
+ (0, exports.command)("artifact.associate", { "type": ArtifactType[artifactType].toLowerCase(), "artifactname": name }, path);
2052
2053
  }
2053
2054
  exports.associateArtifact = associateArtifact;
2054
2055
  //-----------------------------------------------------
@@ -2061,7 +2062,7 @@ exports.associateArtifact = associateArtifact;
2061
2062
  * @returns void
2062
2063
  */
2063
2064
  function uploadBuildLog(path) {
2064
- exports.command("build.uploadlog", null, path);
2065
+ (0, exports.command)("build.uploadlog", null, path);
2065
2066
  }
2066
2067
  exports.uploadBuildLog = uploadBuildLog;
2067
2068
  /**
@@ -2071,7 +2072,7 @@ exports.uploadBuildLog = uploadBuildLog;
2071
2072
  * @returns void
2072
2073
  */
2073
2074
  function updateBuildNumber(value) {
2074
- exports.command("build.updatebuildnumber", null, value);
2075
+ (0, exports.command)("build.updatebuildnumber", null, value);
2075
2076
  }
2076
2077
  exports.updateBuildNumber = updateBuildNumber;
2077
2078
  /**
@@ -2081,7 +2082,7 @@ exports.updateBuildNumber = updateBuildNumber;
2081
2082
  * @returns void
2082
2083
  */
2083
2084
  function addBuildTag(value) {
2084
- exports.command("build.addbuildtag", null, value);
2085
+ (0, exports.command)("build.addbuildtag", null, value);
2085
2086
  }
2086
2087
  exports.addBuildTag = addBuildTag;
2087
2088
  //-----------------------------------------------------
@@ -2095,7 +2096,7 @@ exports.addBuildTag = addBuildTag;
2095
2096
  */
2096
2097
  function updateReleaseName(name) {
2097
2098
  assertAgent("2.132.0");
2098
- exports.command("release.updatereleasename", null, name);
2099
+ (0, exports.command)("release.updatereleasename", null, name);
2099
2100
  }
2100
2101
  exports.updateReleaseName = updateReleaseName;
2101
2102
  //-----------------------------------------------------
@@ -2109,7 +2110,7 @@ exports.ToolRunner = trm.ToolRunner;
2109
2110
  //-----------------------------------------------------
2110
2111
  // async await needs generators in node 4.x+
2111
2112
  if (semver.lt(process.versions.node, '4.2.0')) {
2112
- exports.warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later', exports.IssueSource.TaskInternal);
2113
+ (0, exports.warning)('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later', exports.IssueSource.TaskInternal);
2113
2114
  }
2114
2115
  //-------------------------------------------------------------------
2115
2116
  // Populate the vault with sensitive data. Inputs and Endpoints