v0.7.1
This commit is contained in:
parent
f84d76badf
commit
932d5c380f
3
.changes/v0.7.1.md
Normal file
3
.changes/v0.7.1.md
Normal file
@ -0,0 +1,3 @@
|
||||
## v0.7.1 - 2025-02-14
|
||||
### Fixed
|
||||
* Incorrect local config file loading logic caused files to not be detected
|
@ -6,6 +6,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||
|
||||
|
||||
## v0.7.1 - 2025-02-14
|
||||
### Fixed
|
||||
* Incorrect local config file loading logic caused files to not be detected
|
||||
|
||||
## v0.7.0 - 2025-02-11
|
||||
### Added
|
||||
* [feat]: package `packageOperation` option `checkVersion` implemented
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const versionStr = "0.7.0"
|
||||
const versionStr = "0.7.1"
|
||||
|
||||
var (
|
||||
versionCmd = &cobra.Command{
|
||||
|
@ -85,7 +85,6 @@ func (opts *ConfigOpts) InitConfig() {
|
||||
if err != nil {
|
||||
logging.ExitWithMSG(fmt.Sprintf("error initializing config fetcher: %v", err), 1, nil)
|
||||
}
|
||||
|
||||
if opts.ConfigFilePath != "" {
|
||||
loadConfigFile(fetcher, opts.ConfigFilePath, backyKoanf, opts)
|
||||
} else {
|
||||
@ -109,22 +108,22 @@ func loadConfigFile(fetcher remotefetcher.RemoteFetcher, filePath string, k *koa
|
||||
func loadDefaultConfigFiles(fetcher remotefetcher.RemoteFetcher, configFiles []string, k *koanf.Koanf, opts *ConfigOpts) {
|
||||
cFileFailures := 0
|
||||
for _, c := range configFiles {
|
||||
opts.ConfigFilePath = c
|
||||
data, err := fetcher.Fetch(c)
|
||||
if err != nil {
|
||||
cFileFailures++
|
||||
continue
|
||||
}
|
||||
|
||||
if err := k.Load(rawbytes.Provider(data), yaml.Parser()); err != nil {
|
||||
cFileFailures++
|
||||
continue
|
||||
if data != nil {
|
||||
if err := k.Load(rawbytes.Provider(data), yaml.Parser()); err == nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
if cFileFailures == len(configFiles) {
|
||||
logging.ExitWithMSG("Could not find any valid config file", 1, nil)
|
||||
logging.ExitWithMSG("Could not find any valid local config file", 1, nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user