2021-06-22 19:18:21 +02:00
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
|
});
|
|
|
|
|
};
|
2026-01-30 13:31:20 +01:00
|
|
|
import { DefaultGlobber } from './internal-globber.js';
|
|
|
|
|
import { hashFiles as _hashFiles } from './internal-hash-files.js';
|
2021-06-22 19:18:21 +02:00
|
|
|
/**
|
|
|
|
|
* Constructs a globber
|
|
|
|
|
*
|
|
|
|
|
* @param patterns Patterns separated by newlines
|
|
|
|
|
* @param options Glob options
|
|
|
|
|
*/
|
2026-01-30 13:31:20 +01:00
|
|
|
export function create(patterns, options) {
|
2021-06-22 19:18:21 +02:00
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
2026-01-30 13:31:20 +01:00
|
|
|
return yield DefaultGlobber.create(patterns, options);
|
2021-06-22 19:18:21 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Computes the sha256 hash of a glob
|
|
|
|
|
*
|
|
|
|
|
* @param patterns Patterns separated by newlines
|
2025-06-13 19:44:16 +02:00
|
|
|
* @param currentWorkspace Workspace used when matching files
|
2021-06-22 19:18:21 +02:00
|
|
|
* @param options Glob options
|
2025-06-13 19:44:16 +02:00
|
|
|
* @param verbose Enables verbose logging
|
2021-06-22 19:18:21 +02:00
|
|
|
*/
|
2026-01-30 13:31:20 +01:00
|
|
|
export function hashFiles(patterns_1) {
|
|
|
|
|
return __awaiter(this, arguments, void 0, function* (patterns, currentWorkspace = '', options, verbose = false) {
|
2021-06-22 19:18:21 +02:00
|
|
|
let followSymbolicLinks = true;
|
|
|
|
|
if (options && typeof options.followSymbolicLinks === 'boolean') {
|
|
|
|
|
followSymbolicLinks = options.followSymbolicLinks;
|
|
|
|
|
}
|
|
|
|
|
const globber = yield create(patterns, { followSymbolicLinks });
|
2026-01-30 13:31:20 +01:00
|
|
|
return _hashFiles(globber, currentWorkspace, verbose);
|
2021-06-22 19:18:21 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//# sourceMappingURL=glob.js.map
|