forked from x/icebergs
add some
This commit is contained in:
parent
25ac2e3a1b
commit
7de837851e
@ -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 {
|
||||
|
@ -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), "")
|
||||
|
@ -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()
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user