From 489489745a1f5a8b1695fc36379a8b332234f69e Mon Sep 17 00:00:00 2001 From: ize-302 Date: Fri, 13 Sep 2024 10:42:54 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=93=9A=20docs:=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 129afc6..989a259 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,18 @@ press ENTER --- +## Development + +```bash +# Build +bun run build + +# Run command +./dist/cli.js gitmo -c +``` + +--- + ### Resources used - [Conventional commit types](https://github.com/pvdlg/conventional-commit-types) From 209d4d121f472c759a4c080680b6a6f04f8dc398 Mon Sep 17 00:00:00 2001 From: ize-302 Date: Fri, 13 Sep 2024 10:45:36 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20check=20for=20exi?= =?UTF-8?q?sting=20staged=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/handleCommand.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utils/handleCommand.js b/src/utils/handleCommand.js index 0e25afb..980a627 100644 --- a/src/utils/handleCommand.js +++ b/src/utils/handleCommand.js @@ -59,6 +59,15 @@ const isConventionalCommit = async (commitMessage) => { }; const showCommitPrompt = async () => { + // check if there are staged changes + const status = shell.exec('git status --porcelain', { silent: true }).stdout; + // Parse the status output + const stagedChanges = status.split('\n').filter(line => line.startsWith('A ') || line.startsWith('M ')); + if (stagedChanges.length === 0) { + console.log('You have no changes staged for commit!'); + return; + } + const response = await prompts( { type: "text",