mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-26 02:03:37 +01:00
Improve error message + remove code that disabled error checking on github actions
This commit is contained in:
parent
964f79c037
commit
3bfe88d73e
@ -37,15 +37,19 @@ func main() {
|
||||
if os.Getenv("HISHTORY_TEST") == "" {
|
||||
numImported, err := lib.ImportHistory()
|
||||
lib.CheckFatalError(err)
|
||||
if numImported > 0 {
|
||||
fmt.Printf("Imported %v history entries from your existing shell history", numImported)
|
||||
}
|
||||
}
|
||||
case "import":
|
||||
if os.Getenv("HISHTORY_TEST") == "" {
|
||||
lib.CheckFatalError(fmt.Errorf("the hishtory import command is only meant to be for testing purposes"))
|
||||
}
|
||||
numImported, err := lib.ImportHistory()
|
||||
lib.CheckFatalError(err)
|
||||
if numImported > 0 {
|
||||
fmt.Printf("Imported %v history entries from your existing shell history", numImported)
|
||||
}
|
||||
case "enable":
|
||||
lib.CheckFatalError(lib.Enable())
|
||||
case "disable":
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user