()
| 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); |
nothing calls this directly
no test coverage detected