Skip to content

Commit

Permalink
feat: stop caching rules
Browse files Browse the repository at this point in the history
  • Loading branch information
YairZ101 committed Aug 17, 2022
1 parent 2118c04 commit 71c866e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib/iac/test/v2/setup/local-cache/rules-bundle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@ import * as createDebugLogger from 'debug';

import { TestConfig } from '../../../types';
import { downloadRulesBundle } from './download';
import { lookupLocalRulesBundle } from './lookup-local';

const debugLogger = createDebugLogger('snyk-iac');

export async function initRulesBundle(testConfig: TestConfig): Promise<string> {
debugLogger('Looking for rules bundle locally');
let rulesBundlePath = await lookupLocalRulesBundle(testConfig);
// We are currently using the legacy rules bundle and we need to redownload it each time to use the latest one available.
// debugLogger('Looking for rules bundle locally');
// let rulesBundlePath = await lookupLocalRulesBundle(testConfig);

if (!rulesBundlePath) {
debugLogger(
`Downloading the rules bundle and saving it at ${testConfig.iacCachePath}`,
);
rulesBundlePath = await downloadRulesBundle(testConfig);
}
debugLogger(
`Downloading the rules bundle and saving it at ${testConfig.iacCachePath}`,
);
const rulesBundlePath = await downloadRulesBundle(testConfig);

return rulesBundlePath;
}

0 comments on commit 71c866e

Please sign in to comment.