cicd: Try {configdir}/var/entities/ when looking for entity files as well (#246)
This commit is contained in:
parent
c97fd60c25
commit
77321c1bcd
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
@ -18,6 +19,12 @@ import (
|
||||||
func SetupEntityFileWatchers(cfg *config.Config) {
|
func SetupEntityFileWatchers(cfg *config.Config) {
|
||||||
configDir := filepath.Dir(viper.ConfigFileUsed())
|
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 {
|
for _, ef := range cfg.Entities {
|
||||||
p := ef.File
|
p := ef.File
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue