From 4c3d417725d12210a3ae59e33231f44e96df1b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Tue, 25 Apr 2023 22:45:15 +0200 Subject: [PATCH] Ignore error if default config file does not exist --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7c89c75..7ac84aa 100644 --- a/main.go +++ b/main.go @@ -154,7 +154,11 @@ func main() { filePath := context.String("config") return altsrc.NewTomlSourceFromFile(filePath) } else { - // Fall back to default if config is unset + // Fall back to default if config is unset and path exists + _, err := os.Stat(filepath.Join(os.Getenv("HOME"), ".config/mark")) + if os.IsNotExist(err) { + return &altsrc.MapInputSource{}, nil + } return altsrc.NewTomlSourceFromFile(filepath.Join(os.Getenv("HOME"), ".config/mark")) } }),