Skip to content

Commit 0d07fe0

Browse files
committed
fix(prompts): make --fgm override OCO_EMOJI config
getCommitConvention gated the entire GitMoji branch on config.OCO_EMOJI, so --fgm was silently ignored unless the user had previously run `oco config set OCO_EMOJI true`. Since OCO_EMOJI defaults to false, --fgm was a no-op for most users. This violates the standard CLI convention that command-line flags should override configuration. Restructure getCommitConvention so that --fgm forces FULL_GITMOJI_SPEC regardless of OCO_EMOJI: --fgm=true → FULL_GITMOJI_SPEC --fgm=false + OCO_EMOJI=true → GITMOJI_HELP (unchanged) --fgm=false + OCO_EMOJI=false → CONVENTIONAL_COMMIT_KEYWORDS (unchanged) No other files need changes — the fgm flag was already threaded correctly through cli.ts → commit.ts → generateCommitMessageByDiff → getMainCommitPrompt → getCommitConvention.
1 parent b7922a9 commit 0d07fe0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/prompts.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ const CONVENTIONAL_COMMIT_KEYWORDS =
9595
'Do not preface the commit with anything, except for the conventional commit keywords: fix, feat, build, chore, ci, docs, style, refactor, perf, test.';
9696

9797
const getCommitConvention = (fullGitMojiSpec: boolean) =>
98-
config.OCO_EMOJI
99-
? fullGitMojiSpec
100-
? FULL_GITMOJI_SPEC
101-
: GITMOJI_HELP
102-
: CONVENTIONAL_COMMIT_KEYWORDS;
98+
fullGitMojiSpec
99+
? FULL_GITMOJI_SPEC
100+
: config.OCO_EMOJI
101+
? GITMOJI_HELP
102+
: CONVENTIONAL_COMMIT_KEYWORDS;
103103

104104
const getDescriptionInstruction = () =>
105105
config.OCO_DESCRIPTION

0 commit comments

Comments
 (0)