Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function main(): Promise {
try {
const config = createConfig();
const {
cacheStorageConfig,
clearOutputFolder,
hashGlobs,
internalCacheFolder,
logFolder,
logLevel,
outputFolder,
packageRoot
} = config;
if (logLevel) {
setLogLevel(logLevel);
}
const helpString = "Backfills unchanged packages.";
export async function generateHashOfFiles(
packageRoot: string,
glob?: string[]
): Promise {
if (!glob) {
glob = createConfig(packageRoot).hashGlobs;
}
const files = await fg(glob, {
cwd: packageRoot,
onlyFiles: false,
objectMode: true
});
files.sort((a, b) => a.path.localeCompare(b.path));
const hashes = await Promise.all(
files.map(async file => {
const hasher = crypto.createHash("sha1");
hasher.update(file.path);
if (!file.dirent.isDirectory()) {