1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-25 17:18:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-04-24 10:23:18 +08:00
parent f0ad76fe71
commit fe89d6346c
6 changed files with 17 additions and 9 deletions

View File

@ -14,10 +14,10 @@ func _trash_create(m *ice.Message, from string) {
return
}
s, e := StatFile(m, from)
defer Remove(m, from)
if m.WarnNotFound(e, from) {
return
}
defer Remove(m, from)
p := path.Join(ice.VAR_TRASH, path.Base(from))
kit.If(!s.IsDir(), func() { Open(m, from, func(r io.Reader) { p = path.Join(ice.VAR_TRASH, kit.HashsPath(r)) }) })
RemoveAll(m, p)

View File

@ -312,17 +312,15 @@ func init() {
}},
mdb.ICONS: {Hand: func(m *ice.Message, arg ...string) {
cli.NodeInfo(m, ice.Info.Pathname, WORKER, arg[0])
mdb.Config(m, mdb.ICONS, arg[0])
m.Cmd(SERVE, m.ActionKey(), arg)
}},
ice.MAIN: {Name: "main index", Help: "首页", Hand: func(m *ice.Message, arg ...string) {
ice.MAIN: {Name: "main index", Hand: func(m *ice.Message, arg ...string) {
if len(arg) > 0 {
mdb.Config(m, ice.MAIN, m.Option(ctx.INDEX))
ice.Info.NodeMain = m.Option(ctx.INDEX)
m.Cmd(SERVE, m.ActionKey(), arg)
return
}
kit.If(mdb.Config(m, ice.MAIN), func(cmd string) { RenderPodCmd(m, "", cmd) }, func() { RenderMain(m) })
m.Optionv(ice.MSG_ARGS, kit.Simple(m.Optionv(ice.MSG_ARGS)))
kit.If(ice.Info.NodeMain, func(cmd string) { RenderPodCmd(m, "", cmd) }, func() { RenderMain(m) })
}},
ice.INFO: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
m.Push(mdb.TIME, ice.Info.Make.Time)

View File

@ -181,6 +181,8 @@ const ( // DIR
LICENSE = "LICENSE"
GO_MOD = "go.mod"
GO_SUM = "go.sum"
GO_WORK = "go.work"
GO_WORK_SUM = "go.work.sum"
ICE_BIN = "ice.bin"
CAN_PLUGIN = "can._plugin"
)

View File

@ -178,8 +178,15 @@ func init() {
_autogen_script(m, p)
}
}},
DEVPACK: {Help: "开发", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(WEBPACK, mdb.REMOVE) }},
WEBPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(WEBPACK, mdb.CREATE) }},
DEVPACK: {Help: "开发", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(WEBPACK, mdb.REMOVE)
m.Cmd(web.DREAM, nfs.GOWORK)
}},
WEBPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(WEBPACK, mdb.CREATE)
nfs.Trash(m, ice.GO_WORK_SUM)
nfs.Trash(m, ice.GO_WORK)
}},
BINPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) {
const (
USR_RELEASE_CONF_GO = "usr/release/conf.go"

View File

@ -63,6 +63,7 @@ type info struct {
NodeName string
NodeType string
NodeIcon string
NodeMain string
Pwd string
Lang string

View File

@ -227,7 +227,7 @@ func _repos_status(m *ice.Message, p string, repos *git.Repository) error {
if err != nil {
return err
}
ignore := []string{}
ignore := []string{ice.GO_WORK, ice.GO_WORK_SUM}
nfs.Exists(m, path.Join(_repos_path(m, p), ".gitignore"), func(p string) { ignore = kit.Split(m.Cmdx(nfs.CAT, p), lex.NL) })
for k, v := range status {
if kit.HasPrefix(k, nfs.PT) || (kit.HasPrefix(k, ignore...) && !strings.HasPrefix(k, ice.USR_LOCAL_EXPORT)) {