mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
5e781b2528
commit
7588d84b62
@ -257,7 +257,7 @@ func init() {
|
||||
LOGIN, ice.TRUE, SHARE, ice.TRUE, SPACE, ice.TRUE,
|
||||
ice.VOLCANOS, ice.TRUE, ice.PUBLISH, ice.TRUE,
|
||||
ice.INTSHELL, ice.TRUE, ice.REQUIRE, ice.TRUE,
|
||||
"x", ice.TRUE,
|
||||
"help", ice.TRUE, "x", ice.TRUE,
|
||||
), LOGHEADERS, ice.FALSE,
|
||||
|
||||
kit.MDB_PATH, kit.Dict("/", ice.USR_VOLCANOS),
|
||||
|
@ -1,44 +1,29 @@
|
||||
package code
|
||||
|
||||
import (
|
||||
"path"
|
||||
|
||||
ice "shylinux.com/x/icebergs"
|
||||
"shylinux.com/x/icebergs/base/cli"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
const PYTHON = "python"
|
||||
|
||||
func init() {
|
||||
Index.Merge(&ice.Context{
|
||||
Configs: map[string]*ice.Config{
|
||||
PYTHON: {Name: PYTHON, Help: "脚本命令", Value: kit.Data(
|
||||
cli.SOURCE, "http://mirrors.sohu.com/python/3.5.2/Python-3.5.2.tar.xz",
|
||||
PYTHON, "python",
|
||||
)},
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
PYTHON: {Name: "python port path auto start build download", Help: "脚本命令", Action: map[string]*ice.Action{
|
||||
web.DOWNLOAD: {Name: "download", Help: "下载", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(INSTALL, web.DOWNLOAD, m.Conf(PYTHON, kit.Keym(cli.SOURCE)))
|
||||
}},
|
||||
cli.BUILD: {Name: "build", Help: "构建", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(INSTALL, cli.BUILD, m.Conf(PYTHON, kit.Keym(cli.SOURCE)))
|
||||
}},
|
||||
cli.START: {Name: "start", Help: "启动", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(INSTALL, cli.START, m.Conf(PYTHON, kit.Keym(cli.SOURCE)), "bin/python3")
|
||||
}},
|
||||
ice.RUN: {Name: "run", Help: "运行", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(cli.SYSTEM, m.Conf(PYTHON, kit.Keym(PYTHON)), arg)
|
||||
}},
|
||||
"pip": {Name: "pip", Help: "安装", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(cli.SYSTEM, m.Conf(PYTHON, kit.Keym("pip")), "install", arg)
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Cmdy(INSTALL, path.Base(m.Conf(PYTHON, kit.META_SOURCE)), arg)
|
||||
Index.Merge(&ice.Context{Configs: map[string]*ice.Config{
|
||||
PYTHON: {Name: PYTHON, Help: "脚本命令", Value: kit.Data(
|
||||
cli.SOURCE, "http://mirrors.sohu.com/python/3.5.2/Python-3.5.2.tar.xz",
|
||||
PYTHON, "python", "pip", "pip",
|
||||
)},
|
||||
}, Commands: map[string]*ice.Command{
|
||||
PYTHON: {Name: "python path auto order build download", Help: "脚本命令", Action: ice.MergeAction(map[string]*ice.Action{
|
||||
ice.RUN: {Name: "run", Help: "运行", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(cli.SYSTEM, m.Config(PYTHON), arg)
|
||||
}},
|
||||
},
|
||||
})
|
||||
"pip": {Name: "pip", Help: "安装", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(cli.SYSTEM, m.Config("pip"), "install", arg)
|
||||
}},
|
||||
}, InstallAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Cmdy(INSTALL, cli.SOURCE, m.Config(cli.SOURCE), arg)
|
||||
}},
|
||||
}})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user