From f25a2b422069e71200a4b02182a4bf7885c74323 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Wed, 10 Nov 2021 15:53:10 +0800 Subject: [PATCH] opt feel --- core/wiki/feel.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/wiki/feel.go b/core/wiki/feel.go index bf7178db..8bf78a52 100644 --- a/core/wiki/feel.go +++ b/core/wiki/feel.go @@ -1,7 +1,11 @@ package wiki import ( + "os" + "strings" + ice "shylinux.com/x/icebergs" + "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" ) @@ -20,6 +24,10 @@ func init() { web.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) { _wiki_upload(m, m.CommandKey(), m.Option(kit.MDB_PATH)) }}, + mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) { + os.Remove(strings.TrimPrefix(arg[0], "/share/local/")) + m.ProcessHold() + }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { _wiki_list(m, m.CommandKey(), kit.Select("./", arg, 0)) }},