Commit 359a48a
committed
chore(cmd): Refactor commit message language and model handling
- Add `commitLang` and `commitModel` variables
- Replace `commitCmd.PersistentFlags().StringP` with `commitCmd.PersistentFlags().StringVar`
- Remove `commit.lang` and `commit.model` bindings
- Use `prompt.GetLanguage` to check for default language
- Use `openai.GetModel` to check for default model
- Remove `color.Green("Summarize the commit message use " + viper.GetString("openai.model") + " model")` from line 49
- Set `viper.Set("output.lang", commitLang)` if `prompt.GetLanguage(commitLang) != prompt.DefaultLanguage`
- Add `color.Green("Summarize the commit message use " + viper.GetString("openai.model") + " model")` to line 81
- Add error handling for translation in the `if` statement in lines 87-961 parent 0b255fe commit 359a48a
1 file changed
+16
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | | - | |
46 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
47 | 54 | | |
48 | 55 | | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| |||
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
107 | | - | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
0 commit comments