From ec3d84701061ca236c1f1b14792fa3f13da50506 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Mon, 14 Feb 2022 16:49:46 +0800 Subject: [PATCH] opt webpack --- base/nfs/dir.go | 5 +++-- base/web/dream.go | 2 +- core/code/webpack.go | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/base/nfs/dir.go b/base/nfs/dir.go index 4b4cdaac..0e2a0392 100644 --- a/base/nfs/dir.go +++ b/base/nfs/dir.go @@ -20,7 +20,7 @@ func _dir_list(m *ice.Message, root string, name string, level int, deep bool, d return m // 没有权限 } - if len(ice.Info.Pack) > 0 && name != ice.USR { + if len(ice.Info.Pack) > 0 && m.Option(DIR_PACK) == ice.TRUE { for k, b := range ice.Info.Pack { p := strings.TrimPrefix(k, root) if !strings.HasPrefix(p, name) { @@ -31,7 +31,7 @@ func _dir_list(m *ice.Message, root string, name string, level int, deep bool, d } } - m.Debug("cat binpack %s", p) + m.Debug("dir binpack %s", p) for _, field := range fields { switch field { case PATH: @@ -209,6 +209,7 @@ const ( TYPE_BOTH = "both" ) const ( + DIR_PACK = "dir_pack" DIR_ROOT = "dir_root" DIR_TYPE = "dir_type" DIR_DEEP = "dir_deep" diff --git a/base/web/dream.go b/base/web/dream.go index 6f6950f5..88a4341e 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -88,7 +88,7 @@ func _dream_show(m *ice.Message, name string) { m.Optionv(cli.CMD_OUTPUT, path.Join(p, m.Config(kit.Keys(cli.ENV, cli.CTX_LOG)))) // 启动任务 - bin := cli.SystemFind(m, "ice.bin", kit.Path(path.Join(p, ice.BIN)), "./bin") + bin := cli.SystemFind(m, "ice.bin", kit.Path(path.Join(p, ice.BIN)), kit.Path(ice.BIN)) m.Cmd(cli.DAEMON, kit.Select(kit.Path(os.Args[0]), bin), SPACE, tcp.DIAL, ice.DEV, ice.OPS, mdb.NAME, name, m.OptionSimple(RIVER)) defer m.Event(DREAM_CREATE, kit.SimpleKV("", m.Option(mdb.TYPE), name)...) m.Sleep3s() diff --git a/core/code/webpack.go b/core/code/webpack.go index bec34940..b16c9b72 100644 --- a/core/code/webpack.go +++ b/core/code/webpack.go @@ -46,6 +46,7 @@ func init() { m.Option(nfs.DIR_ROOT, dir) m.Option(nfs.DIR_DEEP, true) + m.Option(nfs.DIR_PACK, true) m.Option(nfs.DIR_TYPE, nfs.CAT) for _, k := range []string{"lib", "panel", "plugin"} {