From 3bfe88d73ef8978ecafca0e23dbd44588748903b Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sat, 17 Sep 2022 22:45:07 -0700 Subject: [PATCH] Improve error message + remove code that disabled error checking on github actions --- hishtory.go | 8 ++++++-- shared/testutils.go | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hishtory.go b/hishtory.go index 95a47c4..7d59ba6 100644 --- a/hishtory.go +++ b/hishtory.go @@ -37,7 +37,9 @@ func main() { if os.Getenv("HISHTORY_TEST") == "" { numImported, err := lib.ImportHistory() lib.CheckFatalError(err) - fmt.Printf("Imported %v history entries from your existing shell history", numImported) + if numImported > 0 { + fmt.Printf("Imported %v history entries from your existing shell history", numImported) + } } case "import": if os.Getenv("HISHTORY_TEST") == "" { @@ -45,7 +47,9 @@ func main() { } numImported, err := lib.ImportHistory() lib.CheckFatalError(err) - fmt.Printf("Imported %v history entries from your existing shell history", numImported) + if numImported > 0 { + fmt.Printf("Imported %v history entries from your existing shell history", numImported) + } case "enable": lib.CheckFatalError(lib.Enable()) case "disable": diff --git a/shared/testutils.go b/shared/testutils.go index 3531deb..26cc94f 100644 --- a/shared/testutils.go +++ b/shared/testutils.go @@ -118,7 +118,7 @@ func BackupAndRestoreEnv(k string) func() { } func checkError(err error) { - if err != nil && os.Getenv("GITHUB_ACTION") == "" { + if err != nil { _, filename, line, _ := runtime.Caller(1) _, cf, cl, _ := runtime.Caller(2) log.Fatalf("testutils fatal error at %s:%d (caller: %s:%d): %v", filename, line, cf, cl, err)