Fix tests and squelch warning if config file not found

This commit is contained in:
James Mills 2023-03-27 00:46:09 +10:00
parent f64268f9cd
commit dfaa5cd490
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
5 changed files with 7 additions and 5 deletions

View File

@ -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 {

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>