1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
shaoying 2020-08-30 12:43:04 +08:00
parent 568e026913
commit 13714d65b7
4 changed files with 11 additions and 4 deletions

View File

@ -294,7 +294,14 @@ func (f *Frame) Start(m *ice.Message, arg ...string) bool {
f.target = m.Source() f.target = m.Source()
break break
} }
if s, e := os.Open(arg[0]); !m.Warn(e != nil, "%s", e) { s, e := os.Open(arg[0])
if os.IsNotExist(e) && strings.HasPrefix(arg[0], "usr") {
ls := strings.Split(arg[0], "/")
m.Cmd("web.code.git.repos", ls[1], "usr/"+ls[1])
s, e = os.Open(arg[0])
}
if !m.Warn(e != nil, "%s", e) {
defer s.Close() defer s.Close()
buf := bytes.NewBuffer(make([]byte, 0, 4096)) buf := bytes.NewBuffer(make([]byte, 0, 4096))

View File

@ -74,7 +74,7 @@ var Index = &ice.Context{Name: GIT, Help: "代码库",
}) })
}}, }},
GIT: {Name: "git port=auto path=auto auto 启动:button 构建:button 下载:button", Help: "编辑器", Action: map[string]*ice.Action{ GIT: {Name: "git port=auto path=auto auto 构建 下载", Help: "编辑器", Action: map[string]*ice.Action{
"download": {Name: "download", Help: "下载", Hand: func(m *ice.Message, arg ...string) { "download": {Name: "download", Help: "下载", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(code.INSTALL, "download", m.Conf(GIT, kit.META_SOURCE)) m.Cmdy(code.INSTALL, "download", m.Conf(GIT, kit.META_SOURCE))
}}, }},

View File

@ -52,7 +52,7 @@ var Index = &ice.Context{Name: VIM, Help: "编辑器",
m.Cmd("web.spide_rewrite", "create", "from", "https://raw.githubusercontent.com/shylinux/contexts/master/etc/conf/plug.vim", "to", "http://localhost:9020/publish/plug.vim") m.Cmd("web.spide_rewrite", "create", "from", "https://raw.githubusercontent.com/shylinux/contexts/master/etc/conf/plug.vim", "to", "http://localhost:9020/publish/plug.vim")
m.Cmd("nfs.file_rewrite", "create", "from", "etc/conf/plug.vim", "to", "https://raw.githubusercontent.com/shylinux/contexts/master/etc/conf/plug.vim") m.Cmd("nfs.file_rewrite", "create", "from", "etc/conf/plug.vim", "to", "https://raw.githubusercontent.com/shylinux/contexts/master/etc/conf/plug.vim")
}}, }},
VIM: {Name: "vim port=auto path=auto auto 启动:button 构建:button 下载:button", Help: "编辑器", Action: map[string]*ice.Action{ VIM: {Name: "vim port=auto path=auto auto 构建 下载", Help: "编辑器", Action: map[string]*ice.Action{
"download": {Name: "download", Help: "下载", Hand: func(m *ice.Message, arg ...string) { "download": {Name: "download", Help: "下载", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(code.INSTALL, "download", m.Conf(VIM, kit.META_SOURCE)) m.Cmdy(code.INSTALL, "download", m.Conf(VIM, kit.META_SOURCE))
}}, }},

View File

@ -72,7 +72,7 @@ var Index = &ice.Context{Name: ZSH, Help: "命令行",
}}, }},
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
m.Cmd("web.spide_rewrite", "create", "from", "https://sourceforge.net/projects/zsh/files/zsh/5.8/zsh-5.8.tar.xz", "to", "http://localhost:9020/publish/zsh-5.8.tar.gz") // m.Cmd("web.spide_rewrite", "create", "from", "https://sourceforge.net/projects/zsh/files/zsh/5.8/zsh-5.8.tar.xz", "to", "http://localhost:9020/publish/zsh-5.8.tar.gz")
m.Conf(web.FAVOR, "meta.render.shell", m.AddCmd(&ice.Command{Name: "render type name text", Help: "渲染引擎", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Conf(web.FAVOR, "meta.render.shell", m.AddCmd(&ice.Command{Name: "render type name text", Help: "渲染引擎", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
value, _ := m.Optionv(kit.MDB_VALUE).(map[string]interface{}) value, _ := m.Optionv(kit.MDB_VALUE).(map[string]interface{})