Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
feat: 🎸 add disable emoji flag
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Jan 23, 2020
1 parent a1a4a5e commit 52a43d9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -38,6 +36,7 @@ const main = async () => {
const {
'dry-run': isDryRun,
'non-interactive': isNonInteractiveMode,
'disable-emoji': disableEmoji,
hook: isHook,
body,
breaking,
Expand All @@ -64,6 +63,8 @@ const main = async () => {
console.log('Running in dry mode.');
}

const state = createState({disableEmoji});

if (isNonInteractiveMode) {
await runNonInteractiveMode(state, cliAnswers);
} else {
Expand Down
7 changes: 5 additions & 2 deletions lib/createState.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const getGitRootDir = require('./util/getGitRootDir');
const getConfig = require('./getConfig');

const createState = () => {
const createState = (config = {}) => {
let root;

try {
Expand All @@ -20,7 +20,10 @@ const createState = () => {
subject: '',
type: ''
},
config: getConfig(root),
config: {
...getConfig(root),
...config
},
root
};

Expand Down

0 comments on commit 52a43d9

Please sign in to comment.