MCPcopy Index your code
hub / github.com/bigcommerce/stencil-cli / _getConfig

Method _getConfig

lib/BuildConfigManager.js:53–70  ·  view source on GitHub ↗
(configPath, oldConfigPath)

Source from the content-addressed store, hash-verified

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 {

Callers 1

initConfigMethod · 0.95

Calls 2

_moveOldConfigMethod · 0.95

Tested by

no test coverage detected