mirror of
https://github.com/prymitive/karma
synced 2026-08-23 11:56:20 +00:00
Merge pull request #262 from prymitive/fix-config-fallback
fix(config): default to 'karma.yaml' config file
This commit is contained in:
@@ -3,6 +3,7 @@ package config
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -106,6 +107,12 @@ func (config *configSchema) Read() {
|
||||
|
||||
v.SetConfigType("yaml")
|
||||
configFile := v.GetString("config.file")
|
||||
// if config file is not set then try loading karma.yaml from current directory
|
||||
if configFile == "" {
|
||||
if _, err = os.Stat("karma.yaml"); !os.IsNotExist(err) {
|
||||
configFile = "karma.yaml"
|
||||
}
|
||||
}
|
||||
if configFile != "" {
|
||||
log.Infof("Reading configuration file %s", configFile)
|
||||
v.SetConfigFile(configFile)
|
||||
|
||||
Reference in New Issue
Block a user