mirror of
https://git.mills.io/prologic/zs
synced 2024-11-25 14:56:12 +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 a config file is found, read it in.
|
||||||
if err := viper.ReadInConfig(); err != nil {
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
|
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
|
||||||
log.WithError(err).Warnf("error reading config %s (using defaults)", viper.ConfigFileUsed())
|
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
|
// ParseIgnoreFile parsers a .zsignore file or uses the default if an error occurred
|
||||||
func ParseIgnoreFile(fn string) *ignore.GitIgnore {
|
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>
|
<head>
|
||||||
<title>Hello World</title>
|
<title>Hello World</title>
|
||||||
</head>
|
</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>
|
<p>Hello World!</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
2
testdata/ignore/.test/index.html
vendored
2
testdata/ignore/.test/index.html
vendored
@ -1,5 +1,5 @@
|
|||||||
<html>
|
<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>
|
<p>Simple page</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
2
testdata/simple/.test/index.html
vendored
2
testdata/simple/.test/index.html
vendored
@ -1,5 +1,5 @@
|
|||||||
<html>
|
<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>
|
<p>Simple page</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
2
testdata/variables/.test/index.html
vendored
2
testdata/variables/.test/index.html
vendored
@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Simple</title>
|
<title>Simple</title>
|
||||||
</head>
|
</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>
|
<p>Simple page</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user