mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
Change log level when files are not found (#138)
* Change log level when files are not found * Adding new flag CI
This commit is contained in:
parent
f3ff1dc098
commit
ac8133a8b9
9
main.go
9
main.go
@ -33,6 +33,7 @@ type Flags struct {
|
|||||||
TargetURL string `docopt:"-l"`
|
TargetURL string `docopt:"-l"`
|
||||||
BaseURL string `docopt:"--base-url"`
|
BaseURL string `docopt:"--base-url"`
|
||||||
Config string `docopt:"--config"`
|
Config string `docopt:"--config"`
|
||||||
|
Ci bool `docopt:"--ci"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -70,6 +71,7 @@ Options:
|
|||||||
[default: auto]
|
[default: auto]
|
||||||
-c --config <path> Use the specified configuration file.
|
-c --config <path> Use the specified configuration file.
|
||||||
[default: $HOME/.config/mark]
|
[default: $HOME/.config/mark]
|
||||||
|
--ci Runs on CI mode. It won't fail if files are not found.
|
||||||
-h --help Show this message.
|
-h --help Show this message.
|
||||||
-v --version Show version.
|
-v --version Show version.
|
||||||
`
|
`
|
||||||
@ -121,7 +123,12 @@ func main() {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if len(files) == 0 {
|
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
|
// Loop through files matched by glob pattern
|
||||||
|
Loading…
x
Reference in New Issue
Block a user