Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
buildCommand: BuildCommand,
hasher: IHasher
): Promise {
const {
cacheStorageConfig,
outputFolder,
name,
mode,
logFolder,
producePerformanceLogs,
validateOutput
} = config;
logger.setName(name);
logger.setMode(mode);
logger.setCacheProvider(cacheStorageConfig.provider);
const createPackageHash = async () => await hasher.createPackageHash();
const fetch = async (hash: string) =>
await cacheStorage.fetch(hash, outputFolder);
const run = async () => {
try {
await buildCommand();
} catch (err) {
throw new Error(`Command failed with the following error:\n\n${err}`);
}
};
const put = async (hash: string) => {
try {
await cacheStorage.put(hash, outputFolder);
} catch (err) {
logger.error(