diff --git a/README.md b/README.md index 2e8d214..235c498 100644 --- a/README.md +++ b/README.md @@ -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 @@ -85,7 +86,7 @@ press ENTER bun run build # Run command -node ./dist/cli.js gitmo cm +node ./dist/index.js cm ``` --- diff --git a/src/gitmo.ts b/src/gitmo.ts index b23cc5d..fc039cd 100644 --- a/src/gitmo.ts +++ b/src/gitmo.ts @@ -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"; @@ -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); @@ -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")