1
0
forked from x/icebergs
icebergs/misc/bash/configs.go
2022-07-25 08:11:17 +08:00

22 lines
501 B
Go

package bash
import (
"strings"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/mdb"
)
func init() {
Index.Merge(&ice.Context{Commands: ice.Commands{
"/configs": {Name: "/configs", Help: "配置", Hand: func(m *ice.Message, arg ...string) {
m.Cmd("web.code.git.configs").Tables(func(value ice.Maps) {
if strings.HasPrefix(value[mdb.NAME], "url") {
m.Echo(`git config --global "%s" "%s"`, value[mdb.NAME], value[mdb.VALUE])
m.Echo(ice.NL)
}
})
}},
}})
}