From bd0cd85338df599854d6e5127618c7fe01cbe28b Mon Sep 17 00:00:00 2001 From: Nir Ozery Date: Wed, 2 Aug 2023 10:58:37 +0300 Subject: [PATCH] CR Fixes 2 --- cmd/lakectl/cmd/local_init.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/lakectl/cmd/local_init.go b/cmd/lakectl/cmd/local_init.go index aeb0172e5af..a9ea4f3b6b2 100644 --- a/cmd/lakectl/cmd/local_init.go +++ b/cmd/lakectl/cmd/local_init.go @@ -37,7 +37,7 @@ var localInitCmd = &cobra.Command{ DieErr(err) } if IndexExists(localPath) && !force { - Die(fmt.Sprintf("directory '%s' already linked to a lakefs path, run command with --force to overwrite", localPath), 1) + DieFmt("directory '%s' already linked to a lakefs path, run command with --force to overwrite", localPath) } // dereference @@ -48,10 +48,10 @@ var localInitCmd = &cobra.Command{ } ignoreFile, err := git.Ignore(localPath, []string{localPath, IndexFileName}, []string{IndexFileName}, IgnoreMarker) - if err != nil && !errors.Is(err, git.ErrNotARepository) { - DieErr(err) - } else if err == nil { + if err == nil { fmt.Println("location added to", ignoreFile) + } else if !errors.Is(err, git.ErrNotARepository) { + DieErr(err) } fmt.Printf("Successfully linked local directory '%s' with remote '%s'\n", localPath, remote)