Skip to content

Commit

Permalink
Merge pull request #16 from ize-302/develop
Browse files Browse the repository at this point in the history
feat: list out commit types ✨
  • Loading branch information
ize-302 authored Oct 30, 2024
2 parents 536b4e4 + 8307d61 commit c54df6e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Options:
Commands:
cm [message] Submit commit
ac [message] Ament last commit
ac [message] Amend last commit
list List available commit types
update Update gitmo cli
help [command] display help for command
Expand Down Expand Up @@ -85,7 +86,7 @@ press ENTER
bun run build

# Run command
node ./dist/cli.js gitmo cm
node ./dist/index.js cm
```

---
Expand Down
15 changes: 14 additions & 1 deletion src/gitmo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Command } from "commander";
import shell from "shelljs";
import packageJson from "../package.json";
import emojisData from "@/emojis-data.json";

import transformMessage from "@/utils/transformMessage.js";
import hasStagedChanges from "@/utils/hasStagedChanges.js";
Expand Down Expand Up @@ -38,7 +39,7 @@ const gitmo = () => {

program
.command("ac [message]")
.description("Ament last commit")
.description("Amend last commit")
.action(async (message) => {
if (message) {
const transformedMessage = await transformMessage(message);
Expand All @@ -50,6 +51,18 @@ const gitmo = () => {
}
});

program
.command("list")
.description("List available commit types")
.action(async () => {
console.log("\n COMMIT TYPES \n");
for (let i = 0; i < emojisData.length; i++) {
const { name, emoji, description } = emojisData[i];
console.log(`${emoji} ${name.toString()}: ${description}`);
}
console.log("\n");
});

program
.command("update")
.description("Update gitmo cli")
Expand Down

0 comments on commit c54df6e

Please sign in to comment.