1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-27 01:48:27 +08:00
icebergs/core/code/makefile.go
2023-08-08 03:45:06 +08:00

32 lines
956 B
Go

package code
import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/web/html"
kit "shylinux.com/x/toolkits"
)
func _makefile_xterm(m *ice.Message, arg ...string) {
ctx.Process(m, XTERM, func() []string {
m.Push(ctx.STYLE, html.OUTPUT)
if ls := kit.Simple(kit.UnMarshal(m.Option(ctx.ARGS))); len(ls) > 0 {
return ls
}
return []string{mdb.TYPE, "sh", nfs.PATH, kit.Select("", kit.Dir(arg[2], arg[1]), arg[2] != ice.SRC)}
}, arg...)
}
const MAKEFILE = "makefile"
func init() {
Index.MergeCommands(ice.Commands{
MAKEFILE: {Name: "makefile path auto", Help: "构建", Actions: ice.MergeActions(ice.Actions{
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) { _makefile_xterm(m, arg...) }},
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { _makefile_xterm(m, arg...) }},
}, PlugAction())},
})
}