diff --git a/README.md b/README.md index 1982faaa..41675bc0 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,14 @@ CLI parameters: - `--issues` - `--lerna` +## Disable Emoji +Using `--disable-emoji` flag will disable emoji. + +For example: + +``` +git-cz --disable-emoji +``` ## Commit message format diff --git a/lib/cli.js b/lib/cli.js index b0ac4173..4b4f2116 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -27,8 +27,6 @@ const executeCommand = (command, args = [], env = process.env) => { const main = async () => { try { - const state = createState(); - const {_: args, ...params} = minimist(process.argv.slice(2)); for (const arg of args) { @@ -38,6 +36,7 @@ const main = async () => { const { 'dry-run': isDryRun, 'non-interactive': isNonInteractiveMode, + 'disable-emoji': disableEmoji, hook: isHook, body, breaking, @@ -64,6 +63,8 @@ const main = async () => { console.log('Running in dry mode.'); } + const state = createState({disableEmoji}); + if (isNonInteractiveMode) { await runNonInteractiveMode(state, cliAnswers); } else { diff --git a/lib/createState.js b/lib/createState.js index 92378b46..bc21af93 100644 --- a/lib/createState.js +++ b/lib/createState.js @@ -1,7 +1,7 @@ const getGitRootDir = require('./util/getGitRootDir'); const getConfig = require('./getConfig'); -const createState = () => { +const createState = (config = {}) => { let root; try { @@ -20,7 +20,10 @@ const createState = () => { subject: '', type: '' }, - config: getConfig(root), + config: { + ...getConfig(root), + ...config + }, root };