From 44d802536f21e9ecedd5a636c6df9fccf74ddab8 Mon Sep 17 00:00:00 2001 From: shylinux Date: Mon, 10 Aug 2020 11:55:20 +0800 Subject: [PATCH] opt some --- core/chat/header.go | 1 + core/code/pack.go | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/chat/header.go b/core/chat/header.go index 45035f73..cb26eada 100644 --- a/core/chat/header.go +++ b/core/chat/header.go @@ -35,6 +35,7 @@ func init() { f.WriteString(`Volcanos.meta.pack = ` + kit.Formats(data)) m.Echo(p) } + m.Cmdy("web.code.webpack") }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Echo(m.Conf(HEADER, TITLE)) diff --git a/core/code/pack.go b/core/code/pack.go index 88944f64..a29b3b72 100644 --- a/core/code/pack.go +++ b/core/code/pack.go @@ -80,8 +80,10 @@ func _pack_icebergs(m *ice.Message, pack *os.File) { what = fmt.Sprintf("%v", b) } } - what = strings.ReplaceAll(what, " ", ",") - pack.WriteString(fmt.Sprintf(` "%s": []byte{%v},`+"\n", "usr/icebergs/"+value["path"], what[1:len(what)-1])) + if len(what) > 0 { + what = strings.ReplaceAll(what, " ", ",") + pack.WriteString(fmt.Sprintf(` "%s": []byte{%v},`+"\n", "usr/icebergs/"+value["path"], what[1:len(what)-1])) + } }) pack.WriteString("\n") } @@ -163,10 +165,11 @@ func init() { - - - - + + + + + `, m.Cmdx(nfs.CAT, "usr/volcanos/cache.css"),