(config, content)
| 3 | // Given a config and content, plucks the actual |
| 4 | // settings that we're interested in |
| 5 | function getNormalizedConfig (config, content) { |
| 6 | |
| 7 | if (content && (config === 'package.json')) { |
| 8 | |
| 9 | // PACKAGE.JSON |
| 10 | |
| 11 | // Use the npm config key, be good citizens |
| 12 | if (content.config && content.config.commitizen) { |
| 13 | return content.config.commitizen; |
| 14 | } else if (content.czConfig) { // Old method, will be deprecated in 3.0.0 |
| 15 | |
| 16 | // Suppress during test |
| 17 | if (typeof global.it !== 'function') |
| 18 | { |
| 19 | console.error("\n********\nWARNING: This repository's package.json is using czConfig. czConfig will be deprecated in Commitizen 3. \nPlease use this instead:\n{\n \"config\": {\n \"commitizen\": {\n \"path\": \"./path/to/adapter\"\n }\n }\n}\nFor more information, see: http://commitizen.github.io/cz-cli/\n********\n"); |
| 20 | } |
| 21 | return content.czConfig; |
| 22 | } |
| 23 | } else { |
| 24 | // .cz.json or .czrc |
| 25 | return content; |
| 26 | } |
| 27 | |
| 28 | } |
no outgoing calls
no test coverage detected