Skip to content

Commit 7c406de

Browse files
committed
Refactor configuration loading in main function; replace file check with getConfig call and update output message
1 parent 6a2cf18 commit 7c406de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ai.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var boldGreen *color.Color = color.New(color.FgGreen, color.Bold)
1515
func main() {
1616

1717
// check if file ~/.config/.fast-ai exists, if it does not exist we'll run the setup
18-
_, err := os.Stat(os.Getenv("HOME") + "/.config/.fast-ai")
18+
config, err := getConfig()
1919

2020
if os.IsNotExist(err) || (len(os.Args) == 2 && os.Args[1] == "--config") {
2121
setup()
@@ -46,7 +46,7 @@ func main() {
4646

4747
var messages []groq.ChatCompletionMessage
4848

49-
fmt.Println()
49+
fmt.Println("Config loaded! using Model:", color.YellowString(config.Model))
5050
fmt.Println("Type " + color.YellowString("'exit'") + " or " + color.YellowString("'e'") + " to exit, " + color.YellowString("'config'") + " to re-run setup, or use " + color.YellowString("ai --config") + " to re-run the setup")
5151
fmt.Println()
5252
reader := bufio.NewReader(os.Stdin)

0 commit comments

Comments
 (0)