1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-25 17:18:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-02-04 10:26:51 +08:00
parent cd5882b2ee
commit 85e1f1dcb6
3 changed files with 8 additions and 3 deletions

View File

@ -162,6 +162,7 @@ const (
USR_LOCAL = ice.USR_LOCAL
USR_LOCAL_WORK = ice.USR_LOCAL_WORK
USR_IMAGE = "usr/image/"
USR_MATERIAL = "usr/material/"
USR_LOCAL_IMAGE = "usr/local/image/"
USR_LEARNING_PORTAL = "usr/learning/portal/"
USR_MODULES = "usr/node_modules/"

View File

@ -22,8 +22,9 @@ func init() {
Index.MergeCommands(ice.Commands{
IMAGE: {Name: "image path", Help: "图片", Actions: ice.Actions{
"material": {Hand: func(m *ice.Message, arg ...string) {
m.Info("what %v", m.FormatChain())
m.Cmdy(IMAGE, path.Join("usr/material", strings.TrimPrefix(path.Dir(m.Option("_script")), "usr/"), arg[0]))
if nfs.Exists(m, nfs.USR_MATERIAL) {
m.Cmdy(IMAGE, path.Join(nfs.USR_MATERIAL, strings.TrimPrefix(path.Dir(m.Option("_script")), nfs.USR), arg[0]))
}
}},
}, Hand: func(m *ice.Message, arg ...string) {
arg = _name(m, arg)

View File

@ -5,6 +5,7 @@ import (
"strings"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/nfs"
)
const VIDEO = "video"
@ -13,7 +14,9 @@ func init() {
Index.MergeCommands(ice.Commands{
VIDEO: {Name: "video path", Help: "视频", Actions: ice.Actions{
"material": {Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(VIDEO, path.Join("usr/material", strings.TrimPrefix(path.Dir(m.Option("_script")), "usr/"), arg[0]))
if nfs.Exists(m, nfs.USR_MATERIAL) {
m.Cmdy(VIDEO, path.Join(nfs.USR_MATERIAL, strings.TrimPrefix(path.Dir(m.Option("_script")), nfs.USR), arg[0]))
}
}},
}, Hand: func(m *ice.Message, arg ...string) {
arg = _name(m, arg)