Skip to content

Commit 4a3cf07

Browse files
committed
fix: update config
1 parent 7a71203 commit 4a3cf07

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ test:
3333
ci:
3434
@golangci-lint run -v --timeout=5m
3535

36-
3736
.PHONY: gen
3837
proto-plugin-gen:
3938
cd cmd/protoc-gen-lava && go install -v .

config/config.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,7 @@ func (t *configImpl) initWithDir(v *viper.Viper) (err error) {
242242
return nil
243243
}
244244

245-
var pathList = strListMap(getPathList(), func(str string) string {
246-
return filepath.Join(str, "."+runenv.Project, CfgName)
247-
})
248-
249-
pathList = typex.StrOf(filepath.Join(".lava", CfgName), pathList...)
245+
var pathList = strListMap(getPathList(), func(str string) string { return filepath.Join(str, ".lava", CfgName) })
250246
for i := range pathList {
251247
if t.addConfigPath(v, pathList[i]) {
252248
return
@@ -260,7 +256,9 @@ func (t *configImpl) initWithDir(v *viper.Viper) (err error) {
260256
func (t *configImpl) initApp(v *viper.Viper) error {
261257
// .lava/config/config.dev.yaml
262258
var path = filepath.Join(Home, "config", fmt.Sprintf("%s.%s.%s", CfgName, runenv.Mode, CfgType))
263-
xerror.Assert(!pathutil.IsExist(path), "%s not found", path)
259+
if !pathutil.IsExist(path) {
260+
return nil
261+
}
264262

265263
// 读取配置
266264
dt := xerror.PanicStr(iox.ReadText(path))

version/version.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,9 @@ func init() {
3434
runenv.Domain = Domain
3535
}
3636

37+
if Version == "" {
38+
Version = "v0.0.1"
39+
}
40+
3741
xerror.ExitErr(ver.NewVersion(Version))
3842
}

0 commit comments

Comments
 (0)