From d76ecc9cbc7f2cd1d3fb27dc94a68715281e70f4 Mon Sep 17 00:00:00 2001 From: shaoying Date: Sun, 23 Oct 2022 14:26:57 +0800 Subject: [PATCH] opt some --- core/wiki/word.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/wiki/word.go b/core/wiki/word.go index 16c01b72..60abfb78 100644 --- a/core/wiki/word.go +++ b/core/wiki/word.go @@ -92,16 +92,17 @@ func init() { }}, ice.PLAY: {Name: "play", Help: "演示"}, }, ctx.CmdAction(), mdb.HashAction()), Hand: func(m *ice.Message, arg ...string) { - m.Option(nfs.DIR_REG, m.Config(lex.REGEXP)) if len(arg) == 0 { arg = append(arg, "src/") } + m.Option(nfs.DIR_REG, m.Config(lex.REGEXP)) if m.Option(nfs.DIR_DEEP, ice.TRUE); !_wiki_list(m, m.CommandKey(), arg...) { - if !nfs.ExistsFile(m, arg[0]) && nfs.ExistsFile(m, path.Join("src", arg[0])) { - arg[0] = path.Join("src/", arg[0]) + if !nfs.ExistsFile(m, arg[0]) && nfs.ExistsFile(m, path.Join(ice.SRC, arg[0])) { + arg[0] = path.Join(ice.SRC, arg[0]) } ctx.DisplayLocal(m, "") _word_show(m, arg[0]) + m.StatusTime() } }}, }})