Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
try {
const fileStats = yield fse.lstat(absoluteFilePath);
if (fileStats.isFile()) {
globs.push(FastGlob.escapePath(relativeFilePath));
}
else if (fileStats.isDirectory()) {
const globbedPath = upath.join(FastGlob.escapePath(relativeFilePath), '**');
globs.push(globbedPath);
}
else {
Shout_1.Shout.warning(`Copy skip: ${absoluteFilePath} is neither a file nor a folder?!`);
}
}
catch (e) {
if (FastGlob.isDynamicPattern(relativeFilePath)) {
globs.push(relativeFilePath);
}
}
}
const assets = yield FastGlob(globs, {
cwd: libraryPath
});
const commonPath = this.findCommonParentFolderPath(assets);
for (const asset of assets) {
const absoluteFilePath = upath.join(libraryPath, asset);
const relativeFilePath = upath.relative(commonPath, asset);
const targetFilePath = upath.join(targetPath, relativeFilePath);
const task = this.tryCopyFile(absoluteFilePath, targetFilePath, overwrite);
tasks.push(task);
}
const success = yield Promise.all(tasks);
.some(pattern => fastGlob.isDynamicPattern(pattern, options));