diff --git a/base/ctx/config.go b/base/ctx/config.go index 5e2cb47d..d3dc3750 100644 --- a/base/ctx/config.go +++ b/base/ctx/config.go @@ -36,10 +36,10 @@ func _config_save(m *ice.Message, name string, arg ...string) { data, msg := ice.Map{}, m.Spawn(m.Source()) for _, k := range arg { if v := mdb.Confv(msg, k); _config_only(v, mdb.META) && _config_only(kit.Value(v, mdb.META), - mdb.IMPORTANT, mdb.EXPIRE, mdb.SHORT, mdb.FIELD, mdb.FIELDS, mdb.ACTION, mdb.SORT, mdb.TOOLS, - nfs.SOURCE, nfs.SCRIPT, - lex.REGEXP, nfs.PATH, "link", - "linux", "darwin", "windows", + mdb.IMPORTANT, mdb.EXPIRE, mdb.VENDOR, nfs.SOURCE, nfs.SCRIPT, nfs.PATH, lex.REGEXP, + mdb.SHORT, mdb.FIELD, mdb.SHORTS, mdb.FIELDS, + mdb.ACTION, mdb.SORT, mdb.TOOLS, + "link", "linux", "darwin", "windows", ) { continue } else { diff --git a/base/mdb/hash.go b/base/mdb/hash.go index 22f9fd73..53d7b5e0 100644 --- a/base/mdb/hash.go +++ b/base/mdb/hash.go @@ -4,7 +4,6 @@ import ( "encoding/json" "io" "net/http" - "os" "path" "strings" @@ -103,19 +102,14 @@ func _hash_prunes(m *ice.Message, prefix, chain string, arg ...string) { } func _hash_export(m *ice.Message, prefix, chain, file string) { defer Lock(m, prefix)() - p := kit.Keys(file, JSON) - count := len(Confm(m, prefix, kit.Keys(chain, HASH))) - if count == 0 { - if s, e := os.Stat(p); e == nil && !s.IsDir() { - os.Remove(p) - } + if len(Confm(m, prefix, kit.Keys(chain, HASH))) == 0 { return } - f, p, e := miss.CreateFile(p) + f, p, e := miss.CreateFile(kit.Keys(file, JSON)) m.Assert(e) defer f.Close() defer m.Echo(p) - m.Logs(EXPORT, KEY, path.Join(prefix, chain), FILE, p, COUNT, count) + m.Logs(EXPORT, KEY, path.Join(prefix, chain), FILE, p) en := json.NewEncoder(f) if en.SetIndent("", " "); !m.WarnNotValid(en.Encode(m.Confv(prefix, kit.Keys(chain, HASH))), EXPORT, prefix) { m.Conf(prefix, kit.Keys(chain, HASH), "") diff --git a/base/mdb/zone.go b/base/mdb/zone.go index 00d4e6fb..6a8896d7 100644 --- a/base/mdb/zone.go +++ b/base/mdb/zone.go @@ -60,6 +60,9 @@ func _zone_select(m *ice.Message, prefix, chain, zone string, id string) { } func _zone_export(m *ice.Message, prefix, chain, file string) { defer Lock(m, prefix)() + if len(Confm(m, prefix, kit.Keys(chain, HASH))) == 0 { + return + } f, p, e := miss.CreateFile(kit.Keys(file, CSV)) m.Assert(e) defer f.Close() diff --git a/core/team/epic.go b/core/team/epic.go index 0f1fb989..2afe0731 100644 --- a/core/team/epic.go +++ b/core/team/epic.go @@ -15,7 +15,7 @@ const EPIC = "epic" func init() { Index.MergeCommands(ice.Commands{ - EPIC: {Help: "史记", Actions: ice.MergeActions(ice.Actions{ + EPIC: {Help: "史记", Icon: "Photo Booth.png", Actions: ice.MergeActions(ice.Actions{ mdb.CREATE: {Name: "create time@date zone name"}, mdb.MODIFY: {Name: "modify time zone name"}, }, mdb.ExportHashAction(mdb.FIELD, "time,hash,zone,name")), Hand: func(m *ice.Message, arg ...string) { mdb.HashSelect(m, arg...).Table(func(value ice.Maps) {