From a71932a86c889571763f8cb1867d0a4dcc038564 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 25 May 2020 23:58:02 +0000 Subject: [PATCH 1/2] chore(release): 4.6.0 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [4.6.0](https://github.com/streamich/git-cz/compare/v4.5.0...v4.6.0) (2020-05-25) ### Bug Fixes * 🐛 test when in --dry-run mode ([1697c56](https://github.com/streamich/git-cz/commit/1697c561e8edc613d6087ab2ec84ab7617c0c1e5)) ### Features * 🎸 check for staged files ([c283ad3](https://github.com/streamich/git-cz/commit/c283ad3fac13eaf00a899b49da474c7608a61708)) --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccd02709..e0f54810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# [4.6.0](https://github.com/streamich/git-cz/compare/v4.5.0...v4.6.0) (2020-05-25) + + +### Bug Fixes + +* 🐛 test when in --dry-run mode ([1697c56](https://github.com/streamich/git-cz/commit/1697c561e8edc613d6087ab2ec84ab7617c0c1e5)) + + +### Features + +* 🎸 check for staged files ([c283ad3](https://github.com/streamich/git-cz/commit/c283ad3fac13eaf00a899b49da474c7608a61708)) + # [4.5.0](https://github.com/streamich/git-cz/compare/v4.4.1...v4.5.0) (2020-05-16) From 8ebebd1ebd8bf7d55fd3cac02e5ec98149b62a3a Mon Sep 17 00:00:00 2001 From: Vadim Dalecky Date: Tue, 26 May 2020 11:14:50 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Revert=20"feat:=20=F0=9F=8E=B8=20check=20fo?= =?UTF-8?q?r=20staged=20files"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cli.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 9429a179..15e91372 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -1,4 +1,4 @@ -const {spawn, execSync} = require('child_process'); +const {spawn} = require('child_process'); const fs = require('fs'); const {join} = require('path'); const shellescape = require('any-shell-escape'); @@ -32,20 +32,6 @@ const main = async () => { if (cliOptions.dryRun) { // eslint-disable-next-line no-console console.log('Running in dry mode.'); - } else { - try { - /** - * @author https://github.com/rodrigograca31 - * @see https://github.com/streamich/git-cz/issues/177 - * - * It exits with 1 if there were differences and 0 means no differences. - * Because of that we negate it to only throw an error if there's no files staged - * https://stackoverflow.com/questions/367069/how-can-i-negate-the-return-value-of-a-process - */ - execSync('! git diff HEAD --staged --quiet --exit-code'); - } catch (error) { - throw new Error('No files staged.'); - } } const state = createState({disableEmoji: cliOptions.disableEmoji});