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

Commit

Permalink
chore: 🤖 catch up with master
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed May 16, 2020
2 parents daa52fe + b284b13 commit 4548cca
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 103 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [4.4.1](https://github.com/streamich/git-cz/compare/v4.4.0...v4.4.1) (2020-05-16)


### Bug Fixes

* manually update version ([811025c](https://github.com/streamich/git-cz/commit/811025c962eab12af792c1d071438f26785266fb))

# [4.4.0](https://github.com/streamich/git-cz/compare/v4.3.1...v4.4.0) (2020-05-16)


### Features

* 🎸 add --disable-emoji to --help and parse from CLI ([82dd0c9](https://github.com/streamich/git-cz/commit/82dd0c94ba13c9694d258a9c710f7c94409fa327))
* 🎸 add disable emoji flag ([52a43d9](https://github.com/streamich/git-cz/commit/52a43d95d66a5e0d4a1e1fd92993bf11de102a35))

## [4.3.1](https://github.com/streamich/git-cz/compare/v4.3.0...v4.3.1) (2020-02-03)


Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ git cz

## Custom config

You can provide custom configuration in `changelog.config.js` file
in your repo. Below is default config:
You can provide a custom configuration in a `changelog.config.js` file in your repo, or in any parent folder.
git-cz will search for the closest config file.
Below is default config:

```js
module.exports = {
Expand Down Expand Up @@ -164,6 +165,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 Expand Up @@ -242,4 +251,3 @@ Installs in 0.6s vs 31.1s.
npm i -g mol-conventional-changelog
added 345 packages in 31.076s
```

4 changes: 2 additions & 2 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ const executeCommand = (command, args = [], env = process.env) => {

const main = async () => {
try {
const state = createState();

const {cliAnswers, cliOptions, passThroughParams} = parseArgs();

if (cliOptions.dryRun) {
// eslint-disable-next-line no-console
console.log('Running in dry mode.');
}

const state = createState({disableEmoji: cliOptions.disableEmoji});

if (cliOptions.nonInteractive) {
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
10 changes: 8 additions & 2 deletions lib/getConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ const findOverrides = (root) => {
const dir = root || process.cwd();

for (const file of configFiles) {
const filename = path.join(dir, file);
const filename = path.resolve(dir, file);

if (fs.existsSync(filename)) {
if (fs.existsSync(filename) && fs.statSync(filename).isFile()) {
return require(filename);
}
}

const parent = path.resolve(dir, '..');

if (parent !== dir) {
return findOverrides(parent);
}

const pkgFilename = path.join(dir, 'package.json');

if (fs.existsSync(pkgFilename)) {
Expand Down
5 changes: 4 additions & 1 deletion lib/parseArgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const helpScreen = `
options:
-h, --help show usage information
-v, --version print version info and exit
--disable-emoji don't add emoji to commit title
--non-interactive run git-cz in non-interactive mode
non-interactive mode options:
Expand All @@ -30,6 +31,7 @@ const parseArgs = () => {
_: inputs,
'dry-run': dryRun,
hook,
'disable-emoji': disableEmoji,
'non-interactive': nonInteractive,
body,
breaking,
Expand All @@ -48,7 +50,7 @@ const parseArgs = () => {
h: 'help',
v: 'version'
},
boolean: ['version', 'help', 'non-interactive', 'hook', 'dry-run'],
boolean: ['version', 'help', 'disable-emoji', 'non-interactive', 'hook', 'dry-run'],
string: ['type', 'subject', 'scope', 'body', 'breaking', 'issues', 'learna']
});

Expand All @@ -63,6 +65,7 @@ const parseArgs = () => {
}

const cliOptions = {
disableEmoji,
dryRun,
help,
hook,
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "git-cz",
"version": "3.3.0",
"version": "4.5.0",
"description": "Semantic emojified git commit, git-cz",
"main": "dist/cz.js",
"bin": {
Expand Down Expand Up @@ -31,22 +31,22 @@
"@semantic-release/changelog": "3.0.6",
"@semantic-release/git": "8.0.0",
"any-shell-escape": "0.1.1",
"browserify": "16.5.0",
"browserify": "16.5.1",
"chai": "4.2.0",
"chalk": "2.4.2",
"commitizen": "2.10.1",
"eslint": "4.19.1",
"eslint-config-mailonline": "9.0.0",
"eslint-config-mailonline": "9.0.1",
"fuzzy": "0.1.3",
"global": "4.4.0",
"husky": "4.2.1",
"husky": "4.2.5",
"inquirer": "6.5.2",
"inquirer-list-search-prompt": "1.0.2",
"jest": "^25.1.0",
"minimist": "1.2.0",
"mocha": "6.2.2",
"pkg": "4.4.2",
"rimraf": "3.0.1",
"minimist": "1.2.5",
"mocha": "6.2.3",
"pkg": "4.4.8",
"rimraf": "3.0.2",
"semantic-release": "16.0.4",
"signale": "1.4.0",
"spawncommand": "^2.2.0",
Expand Down
Loading

0 comments on commit 4548cca

Please sign in to comment.