(root)
| 12 | ]; |
| 13 | |
| 14 | const findOverrides = (root) => { |
| 15 | const dir = root || process.cwd(); |
| 16 | |
| 17 | for (const file of configFiles) { |
| 18 | const filename = path.resolve(dir, file); |
| 19 | |
| 20 | if (fs.existsSync(filename) && fs.statSync(filename).isFile()) { |
| 21 | return require(filename); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | const parent = path.resolve(dir, '..'); |
| 26 | |
| 27 | const pkgFilename = path.join(dir, 'package.json'); |
| 28 | |
| 29 | if (fs.existsSync(pkgFilename)) { |
| 30 | try { |
| 31 | const changelog = require(pkgFilename).config.commitizen.changelog; |
| 32 | |
| 33 | if (changelog) { |
| 34 | return changelog; |
| 35 | } |
| 36 | // eslint-disable-next-line no-empty |
| 37 | } catch (error) {} |
| 38 | } |
| 39 | |
| 40 | if (parent !== dir) { |
| 41 | return findOverrides(parent); |
| 42 | } |
| 43 | |
| 44 | return {}; |
| 45 | }; |
| 46 | |
| 47 | const getConfig = (root) => { |
| 48 | const overrides = findOverrides(root); |
no outgoing calls
no test coverage detected
searching dependent graphs…