From ac8133a8b9cc3eacf1deeab12451010c07c62716 Mon Sep 17 00:00:00 2001 From: Mateus Miranda Date: Thu, 2 Dec 2021 09:38:47 +0100 Subject: [PATCH] Change log level when files are not found (#138) * Change log level when files are not found * Adding new flag CI --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7b74efb..0f44a6c 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ type Flags struct { TargetURL string `docopt:"-l"` BaseURL string `docopt:"--base-url"` Config string `docopt:"--config"` + Ci bool `docopt:"--ci"` } const ( @@ -70,6 +71,7 @@ Options: [default: auto] -c --config Use the specified configuration file. [default: $HOME/.config/mark] + --ci Runs on CI mode. It won't fail if files are not found. -h --help Show this message. -v --version Show version. ` @@ -121,7 +123,12 @@ func main() { log.Fatal(err) } if len(files) == 0 { - log.Fatal("No files matched") + msg := "No files matched" + if flags.Ci { + log.Warning(msg) + } else { + log.Fatal(msg) + } } // Loop through files matched by glob pattern