mirror of
https://git.mills.io/prologic/zs
synced 2024-11-22 05:16:11 +03:00
Fix tests and squelch warning if config file not found
This commit is contained in:
parent
f64268f9cd
commit
dfaa5cd490
2
main.go
2
main.go
@ -709,9 +709,11 @@ func initConfig() {
|
||||
|
||||
// If a config file is found, read it in.
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
|
||||
log.WithError(err).Warnf("error reading config %s (using defaults)", viper.ConfigFileUsed())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ParseIgnoreFile parsers a .zsignore file or uses the default if an error occurred
|
||||
func ParseIgnoreFile(fn string) *ignore.GitIgnore {
|
||||
|
2
testdata/extensions/.test/index.html
vendored
2
testdata/extensions/.test/index.html
vendored
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<title>Hello World</title>
|
||||
</head>
|
||||
<body><h1 id="hello-world">Hello World <a class="anchor" href="#hello-world">¶</a></h1>
|
||||
<body><h1 id="hello-world">Hello World <a class="anchor" href="#hello-world"> </a></h1>
|
||||
<p>Hello World!</p>
|
||||
</body>
|
||||
</html>
|
||||
|
2
testdata/ignore/.test/index.html
vendored
2
testdata/ignore/.test/index.html
vendored
@ -1,5 +1,5 @@
|
||||
<html>
|
||||
<body><h1 id="simple">Simple <a class="anchor" href="#simple">¶</a></h1>
|
||||
<body><h1 id="simple">Simple <a class="anchor" href="#simple"> </a></h1>
|
||||
<p>Simple page</p>
|
||||
</body>
|
||||
</html>
|
||||
|
2
testdata/simple/.test/index.html
vendored
2
testdata/simple/.test/index.html
vendored
@ -1,5 +1,5 @@
|
||||
<html>
|
||||
<body><h1 id="simple">Simple <a class="anchor" href="#simple">¶</a></h1>
|
||||
<body><h1 id="simple">Simple <a class="anchor" href="#simple"> </a></h1>
|
||||
<p>Simple page</p>
|
||||
</body>
|
||||
</html>
|
||||
|
2
testdata/variables/.test/index.html
vendored
2
testdata/variables/.test/index.html
vendored
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<title>Simple</title>
|
||||
</head>
|
||||
<body><h1 id="simple">Simple <a class="anchor" href="#simple">¶</a></h1>
|
||||
<body><h1 id="simple">Simple <a class="anchor" href="#simple"> </a></h1>
|
||||
<p>Simple page</p>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user