1
0
forked from x/icebergs
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 return
} }
s, e := StatFile(m, from) s, e := StatFile(m, from)
defer Remove(m, from)
if m.WarnNotFound(e, from) { if m.WarnNotFound(e, from) {
return return
} }
defer Remove(m, from)
p := path.Join(ice.VAR_TRASH, path.Base(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)) }) }) kit.If(!s.IsDir(), func() { Open(m, from, func(r io.Reader) { p = path.Join(ice.VAR_TRASH, kit.HashsPath(r)) }) })
RemoveAll(m, p) RemoveAll(m, p)

View File

@ -312,17 +312,15 @@ func init() {
}}, }},
mdb.ICONS: {Hand: func(m *ice.Message, arg ...string) { mdb.ICONS: {Hand: func(m *ice.Message, arg ...string) {
cli.NodeInfo(m, ice.Info.Pathname, WORKER, arg[0]) cli.NodeInfo(m, ice.Info.Pathname, WORKER, arg[0])
mdb.Config(m, mdb.ICONS, arg[0])
m.Cmd(SERVE, m.ActionKey(), arg) 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 { 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) m.Cmd(SERVE, m.ActionKey(), arg)
return return
} }
kit.If(mdb.Config(m, ice.MAIN), func(cmd string) { RenderPodCmd(m, "", cmd) }, func() { RenderMain(m) }) kit.If(ice.Info.NodeMain, func(cmd string) { RenderPodCmd(m, "", cmd) }, func() { RenderMain(m) })
m.Optionv(ice.MSG_ARGS, kit.Simple(m.Optionv(ice.MSG_ARGS)))
}}, }},
ice.INFO: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) { ice.INFO: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
m.Push(mdb.TIME, ice.Info.Make.Time) m.Push(mdb.TIME, ice.Info.Make.Time)

View File

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

View File

@ -178,8 +178,15 @@ func init() {
_autogen_script(m, p) _autogen_script(m, p)
} }
}}, }},
DEVPACK: {Help: "开发", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(WEBPACK, mdb.REMOVE) }}, DEVPACK: {Help: "开发", Hand: func(m *ice.Message, arg ...string) {
WEBPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(WEBPACK, mdb.CREATE) }}, 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) { BINPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) {
const ( const (
USR_RELEASE_CONF_GO = "usr/release/conf.go" USR_RELEASE_CONF_GO = "usr/release/conf.go"

View File

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

View File

@ -227,7 +227,7 @@ func _repos_status(m *ice.Message, p string, repos *git.Repository) error {
if err != nil { if err != nil {
return err 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) }) 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 { for k, v := range status {
if kit.HasPrefix(k, nfs.PT) || (kit.HasPrefix(k, ignore...) && !strings.HasPrefix(k, ice.USR_LOCAL_EXPORT)) { if kit.HasPrefix(k, nfs.PT) || (kit.HasPrefix(k, ignore...) && !strings.HasPrefix(k, ice.USR_LOCAL_EXPORT)) {