Skip to content

Commit

Permalink
Merge pull request #3 from ize-302/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ize-302 authored Sep 13, 2024
2 parents f102430 + 209d4d1 commit 518346b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions src/utils/handleCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 518346b

Please sign in to comment.