Skip to content

Commit

Permalink
update the documentation and a bit of logging
Browse files Browse the repository at this point in the history
  • Loading branch information
owenrumney-f3 committed Feb 10, 2021
1 parent 25e0889 commit 1533cb5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/squealer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func squeal(_ *cobra.Command, args []string) {
}
cfg, err := config.LoadConfig(configFilePath)
if err != nil {
panic(err)
fail(err)
}

scanner := getScanner(cfg, basePath)
err = scanner.Scan()
if err != nil {
panic(err)
fail(err)
}
metrics := scanner.GetMetrics()
if !concise {
Expand All @@ -64,7 +64,7 @@ func getScanner(cfg *config.Config, basePath string) scan.Scanner {
ToHash: toHash,
})
if err != nil {
panic(err)
fail(err)
}
return scanner
}
Expand Down Expand Up @@ -114,3 +114,8 @@ func listenForExit() {
os.Exit(0)
}()
}

func fail(err error) {
fmt.Println(err.Error())
os.Exit(-1)
}

0 comments on commit 1533cb5

Please sign in to comment.