azure-pipelines-task-lib 5.2.11 → 5.277.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.
Files changed (3) hide show
  1. package/package.json +2 -3
  2. package/task.js +8 -7
  3. package/vault.js +2 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-pipelines-task-lib",
3
- "version": "5.2.11",
3
+ "version": "5.277.0",
4
4
  "description": "Azure Pipelines Task SDK",
5
5
  "main": "./task.js",
6
6
  "typings": "./task.d.ts",
@@ -32,8 +32,7 @@
32
32
  "nodejs-file-downloader": "^4.11.1",
33
33
  "q": "^1.5.1",
34
34
  "semver": "^5.7.2",
35
- "shelljs": "^0.10.0",
36
- "uuid": "^3.0.1"
35
+ "shelljs": "^0.10.0"
37
36
  },
38
37
  "devDependencies": {
39
38
  "@types/minimatch": "3.0.3",
package/task.js CHANGED
@@ -1066,15 +1066,16 @@ function cp(sourceOrOptions, destinationOrSource, optionsOrDestination, continue
1066
1066
  var isPattern = /[*?{\[]/.test(source) || /[@+!]\(/.test(source);
1067
1067
  if (isPattern) {
1068
1068
  var defaultRoot = (0, exports.getVariable)('system.defaultWorkingDirectory') || process.cwd();
1069
- var sourcesToProcess = findMatch(defaultRoot, [source], undefined, { nonegate: true, nocomment: true });
1070
- if (sourcesToProcess.length > 0) {
1071
- for (var _i = 0, sourcesToProcess_1 = sourcesToProcess; _i < sourcesToProcess_1.length; _i++) {
1072
- var src = sourcesToProcess_1[_i];
1073
- cp(src, destination, options, continueOnError, retryCount);
1074
- }
1069
+ var matches = findMatch(defaultRoot, [source], undefined, { nonegate: true, nocomment: true });
1070
+ var resolvedMatches = matches.filter(function (src) { return path.resolve(src) !== path.resolve(source); });
1071
+ for (var _i = 0, resolvedMatches_1 = resolvedMatches; _i < resolvedMatches_1.length; _i++) {
1072
+ var src = resolvedMatches_1[_i];
1073
+ cp(src, destination, options, continueOnError, retryCount);
1074
+ }
1075
+ if (matches.length > 0 && resolvedMatches.length === matches.length) {
1075
1076
  return;
1076
1077
  }
1077
- else {
1078
+ if (matches.length === 0) {
1078
1079
  (0, exports.debug)("No matches found for the pattern: ".concat(source, ". Fallback to check for the literal path."));
1079
1080
  }
1080
1081
  }
package/vault.js CHANGED
@@ -4,7 +4,6 @@ exports.Vault = void 0;
4
4
  var fs = require("fs");
5
5
  var path = require("path");
6
6
  var crypto = require("crypto");
7
- var uuidV4 = require('uuid/v4');
8
7
  var algorithm = "aes-256-ctr";
9
8
  var encryptEncoding = 'hex';
10
9
  var unencryptedEncoding = 'utf8';
@@ -21,8 +20,7 @@ var Vault = /** @class */ (function () {
21
20
  this._store = {};
22
21
  this.genKey();
23
22
  }
24
- Vault.prototype.initialize = function () {
25
- };
23
+ Vault.prototype.initialize = function () { };
26
24
  Vault.prototype.storeSecret = function (name, data) {
27
25
  if (!name || name.length == 0) {
28
26
  return false;
@@ -64,7 +62,7 @@ var Vault = /** @class */ (function () {
64
62
  return crypto.createHash('sha256').update(key).digest();
65
63
  };
66
64
  Vault.prototype.genKey = function () {
67
- fs.writeFileSync(this._keyFile, uuidV4(), { encoding: 'utf8' });
65
+ fs.writeFileSync(this._keyFile, crypto.randomUUID(), { encoding: 'utf8' });
68
66
  };
69
67
  return Vault;
70
68
  }());