Skip to content

Commit c54df6e

Browse files
authored
Merge pull request #16 from ize-302/develop
feat: list out commit types ✨
2 parents 536b4e4 + 8307d61 commit c54df6e

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ Options:
3535
3636
Commands:
3737
cm [message] Submit commit
38-
ac [message] Ament last commit
38+
ac [message] Amend last commit
39+
list List available commit types
3940
update Update gitmo cli
4041
help [command] display help for command
4142
@@ -85,7 +86,7 @@ press ENTER
8586
bun run build
8687

8788
# Run command
88-
node ./dist/cli.js gitmo cm
89+
node ./dist/index.js cm
8990
```
9091

9192
---

src/gitmo.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Command } from "commander";
22
import shell from "shelljs";
33
import packageJson from "../package.json";
4+
import emojisData from "@/emojis-data.json";
45

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

3940
program
4041
.command("ac [message]")
41-
.description("Ament last commit")
42+
.description("Amend last commit")
4243
.action(async (message) => {
4344
if (message) {
4445
const transformedMessage = await transformMessage(message);
@@ -50,6 +51,18 @@ const gitmo = () => {
5051
}
5152
});
5253

54+
program
55+
.command("list")
56+
.description("List available commit types")
57+
.action(async () => {
58+
console.log("\n COMMIT TYPES \n");
59+
for (let i = 0; i < emojisData.length; i++) {
60+
const { name, emoji, description } = emojisData[i];
61+
console.log(`${emoji} ${name.toString()}: ${description}`);
62+
}
63+
console.log("\n");
64+
});
65+
5366
program
5467
.command("update")
5568
.description("Update gitmo cli")

0 commit comments

Comments
 (0)