From b76028f3ba43f37cd4f3a6cf804d3340befbbef4 Mon Sep 17 00:00:00 2001 From: Carl Tashian Date: Tue, 31 Jan 2023 14:39:29 -0800 Subject: [PATCH] Update commands/app.go Co-authored-by: Mariano Cano --- commands/app.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/commands/app.go b/commands/app.go index cf58c37e..daa5aa21 100644 --- a/commands/app.go +++ b/commands/app.go @@ -141,10 +141,13 @@ func appAction(ctx *cli.Context) error { cfg, err := config.LoadConfiguration(configFile) if err != nil && token == "" { - fmt.Println("step-ca can't find or open the configuration file for your CA.") - fmt.Println("You may need to create a CA first by running `step ca init`.") - fmt.Println("Documentation: https://u.step.sm/docs/ca") - fmt.Println("") + var pathErr *os.PathError + if errors.As(err, &pathErr) { + fmt.Println("step-ca can't find or open the configuration file for your CA.") + fmt.Println("You may need to create a CA first by running `step ca init`.") + fmt.Println("Documentation: https://u.step.sm/docs/ca") + os.Exit(1) + } fatal(err) }