From 7ff3914f894336ad243e5f4d90b8c71a7071b4f9 Mon Sep 17 00:00:00 2001 From: darius Date: Fri, 24 May 2024 21:02:44 +0200 Subject: [PATCH] error handle change --- commands/config/subcommands.go | 4 +++- main.go | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/commands/config/subcommands.go b/commands/config/subcommands.go index 13f2cb6..f04a0f9 100644 --- a/commands/config/subcommands.go +++ b/commands/config/subcommands.go @@ -54,8 +54,10 @@ func creatAction(c *cli.Context) error { if err != nil { return err } + fmt.Println("Created: " + configPath) + } else { + fmt.Println("Configuration file already exists") } - fmt.Println("Created: " + configPath) return nil } diff --git a/main.go b/main.go index 6154c4b..85b61a8 100644 --- a/main.go +++ b/main.go @@ -13,11 +13,7 @@ import ( ) func main() { - - Config, err := services.ReadConfig() - if err != nil { - log.Fatalf("Error reading config: %v", err) - } + Config, _ := services.ReadConfig() app := &cli.App{ Name: "KleinCommand",