Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Extra Logs for Config Reading Behaviour #517

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions runner/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,18 @@ func writeDefaultConfig() (string, error) {

func defaultPathConfig() (*Config, error) {
// when path is blank, first find `.air.toml`, `.air.conf` in `air_wd` and current working directory, if not found, use defaults
for _, name := range []string{dftTOML, dftConf} {
cfg, err := readConfByName(name)
if err == nil {
if name == dftConf {
fmt.Println("`.air.conf` will be deprecated soon, recommend using `.air.toml`.")
}
return cfg, nil
}
cfg, err := readConfByName(dftTOML)
if err == nil {
return cfg, nil
}
fmt.Printf("could not read .air.toml {%v}, trying .air.conf\n", err)

cfg, err = readConfByName(dftConf)
if err == nil {
fmt.Println("`.air.conf` will be deprecated soon, recommend using `.air.toml`.")
return cfg, nil
}
fmt.Printf("could not read .air.conf {%v}, using default config\n", err)

dftCfg := defaultConfig()
return &dftCfg, nil
Expand Down
Loading