(configPath, oldConfigPath)
| 51 | } |
| 52 | |
| 53 | async _getConfig(configPath, oldConfigPath) { |
| 54 | if (this._fs.existsSync(configPath)) { |
| 55 | // eslint-disable-next-line import/no-dynamic-require |
| 56 | return require(configPath); |
| 57 | } |
| 58 | if (this._fs.existsSync(oldConfigPath)) { |
| 59 | this._moveOldConfig(configPath, oldConfigPath); |
| 60 | // eslint-disable-next-line import/no-dynamic-require |
| 61 | return require(configPath); |
| 62 | } |
| 63 | |
| 64 | // Fallback to cornerstone default stencil.conf.cjs |
| 65 | const content = await this.downloadFileFromGitHub(cornerstoneConfigLink); |
| 66 | this._fs.writeFileSync(configPath, content); |
| 67 | |
| 68 | // eslint-disable-next-line import/no-dynamic-require |
| 69 | return require(configPath); |
| 70 | } |
| 71 | |
| 72 | async downloadFileFromGitHub(rawUrl) { |
| 73 | try { |
no test coverage detected