cicd: Try {configdir}/var/entities/ when looking for entity files as well (#246)

This commit is contained in:
James Read 2024-03-15 10:07:51 +00:00 committed by GitHub
parent c97fd60c25
commit 77321c1bcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import (
"github.com/spf13/viper"
"gopkg.in/yaml.v3"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
@ -18,6 +19,12 @@ import (
func SetupEntityFileWatchers(cfg *config.Config) {
configDir := filepath.Dir(viper.ConfigFileUsed())
configDirVar := filepath.Join(configDir, "var") // for development purposes
if _, err := os.Stat(configDirVar); err == nil {
configDir = configDirVar
}
for _, ef := range cfg.Entities {
p := ef.File