Skip to content

Commit 40bd1a2

Browse files
committed
refactor(cz-git): optimize the prompt msg when alias undefined
1 parent ba111c2 commit 40bd1a2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/cz-git/src/generator/message.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import type { Answers, CommitizenGitOptions } from "../shared";
1010

1111
export const getAliasMessage = (config: CommitizenGitOptions, alias?: string) => {
1212
if (!alias || typeof config?.alias?.[alias] !== "string") {
13-
throw new Error(`${style.red(`>>> The alias "${alias}" is not defined`)}`);
13+
throw new Error(`${style.red(`>>> The alias "${alias}" is undefined`)}
14+
15+
${style.yellow(">>> The currently obtained alias configuration:")}
16+
${style.cyan(JSON.stringify(config.alias, null, 2))}
17+
`);
1418
}
1519
console.log(`${style.green(`>>> Using "${alias}" commit message alias:`)}`);
1620
console.log(`${style.gray(config.alias[alias])}`);

0 commit comments

Comments
 (0)