MCPcopy Create free account
hub / github.com/bigcommerce/stencil-cli / run

Method run

lib/nodeSass/AutoFixer.js:29–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 }
28
29 async run() {
30 const assetsPath = path.join(this.themePath, 'assets');
31 const rawConfig = await this.themeConfig.getConfig();
32 const cssFiles = await this.validator.getCssFiles();
33 let issuesDetected = false;
34 /* eslint-disable-next-line no-useless-catch */
35 try {
36 for await (const file of cssFiles) {
37 try {
38 /* eslint-disable-next-line no-await-in-loop */
39 await cssCompiler.compile(
40 rawConfig,
41 assetsPath,
42 file,
43 cssCompiler.SASS_ENGINE_NAME,
44 );
45 } catch (e) {
46 issuesDetected = true;
47 await this.tryToFix(e, file);
48 }
49 }
50 if (!issuesDetected) {
51 console.log('No issues detected');
52 }
53 } catch (e) {
54 throw e;
55 }
56 }
57
58 async tryToFix(err, file) {
59 const problem = this.detectProblem(err);

Callers

nothing calls this directly

Calls 4

tryToFixMethod · 0.95
getConfigMethod · 0.80
getCssFilesMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected