From 2f218bd99f4153fda64b8f1f1afb234566f7b845 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Sat, 2 Oct 2021 22:37:30 +0200 Subject: [PATCH] fix: ensure ~/.abra is created Also make that debug message less cringe. --- cli/cli.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/cli.go b/cli/cli.go index 81e8c323b..a20013974 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -9,6 +9,7 @@ import ( "coopcloud.tech/abra/cli/catalogue" "coopcloud.tech/abra/cli/recipe" "coopcloud.tech/abra/cli/server" + "coopcloud.tech/abra/pkg/config" logrusStack "github.com/Gurpartap/logrus-stack" "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" @@ -84,7 +85,13 @@ func RunApp(version, commit string) { return nil } - logrus.Debugf("Flying abra version '%s', commit '%s', enjoy the ride", version, commit) + if err := os.Mkdir(config.ABRA_DIR, 0755); err != nil { + if !os.IsExist(err) { + logrus.Fatal(err) + } + } + + logrus.Debugf("abra version '%s', commit '%s'", version, commit) if err := app.Run(os.Args); err != nil { logrus.Fatal(err)