azure-pipelines-task-lib 5.2.10 → 5.276.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 +11 -11
  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.10",
3
+ "version": "5.276.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
@@ -1063,20 +1063,20 @@ function cp(sourceOrOptions, destinationOrSource, optionsOrDestination, continue
1063
1063
  if (!fs.existsSync(destination) && !force) {
1064
1064
  throw new Error((0, exports.loc)('LIB_PathNotFound', 'cp', destination));
1065
1065
  }
1066
- var isPattern = /[*?{\[]/.test(source) || /^[#!]/.test(source) || /[@+!]\(/.test(source);
1066
+ var isPattern = /[*?{\[]/.test(source) || /[@+!]\(/.test(source);
1067
1067
  if (isPattern) {
1068
- var sourcesToProcess = [];
1069
- var sourceDir = path.dirname(source);
1070
- sourceDir = sourceDir == '.' ? path.resolve() : sourceDir;
1071
- sourcesToProcess = findMatch(sourceDir, [path.basename(source)]);
1072
- if (sourcesToProcess.length === 0) {
1073
- (0, exports.debug)("No matches found for pattern: ".concat(source));
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
+ }
1075
+ return;
1074
1076
  }
1075
- for (var _i = 0, sourcesToProcess_1 = sourcesToProcess; _i < sourcesToProcess_1.length; _i++) {
1076
- var src = sourcesToProcess_1[_i];
1077
- cp(src, destination, options, continueOnError, retryCount);
1077
+ else {
1078
+ (0, exports.debug)("No matches found for the pattern: ".concat(source, ". Fallback to check for the literal path."));
1078
1079
  }
1079
- return;
1080
1080
  }
1081
1081
  var lstatSource = fs.lstatSync(source);
1082
1082
  if (!recursive && lstatSource.isDirectory()) {
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
  }());