forked from x/icebergs
add some
This commit is contained in:
parent
4cc9da13c5
commit
586610ce64
@ -157,11 +157,15 @@ func _dream_start(m *ice.Message, name string) {
|
||||
func _dream_binary(m *ice.Message, p string) {
|
||||
if bin := path.Join(m.Option(cli.CMD_DIR), ice.BIN_ICE_BIN); nfs.Exists(m, bin) {
|
||||
return
|
||||
} else if kit.IsUrl(p) {
|
||||
} else if kit.IsUrl(p) || strings.HasPrefix(p, S()) {
|
||||
GoToast(m, DOWNLOAD, func(toast func(string, int, int)) (list []string) {
|
||||
begin := time.Now()
|
||||
SpideSave(m, bin, kit.MergeURL(p, cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH), func(count, total, value int) {
|
||||
toast(m.Option(mdb.NAME)+"\n"+kit.FormatShow(cli.COST, kit.FmtDuration(time.Now().Sub(begin))), count, total)
|
||||
if strings.HasPrefix(p, S()) {
|
||||
toast(m.Option(mdb.NAME), count, total)
|
||||
} else {
|
||||
toast(m.Option(mdb.NAME)+"\n"+kit.FormatShow(cli.COST, kit.FmtDuration(time.Now().Sub(begin))), count, total)
|
||||
}
|
||||
})
|
||||
return nil
|
||||
})
|
||||
|
@ -4,10 +4,12 @@ import (
|
||||
"strings"
|
||||
|
||||
ice "shylinux.com/x/icebergs"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/cli"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/tcp"
|
||||
"shylinux.com/x/icebergs/base/web/html"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
@ -76,6 +78,9 @@ func init() {
|
||||
}},
|
||||
INSTALL: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.OptionDefault(nfs.BINARY, UserHost(m)+S(m.Option(mdb.NAME)))
|
||||
if kit.IsIn(m.Cmdv(Space(m, m.Option(DOMAIN)), SPIDE, ice.DEV_IP, CLIENT_HOSTNAME), m.Cmd(tcp.HOST).Appendv(aaa.IP)...) {
|
||||
m.Option(nfs.BINARY, S(m.Option(mdb.NAME)))
|
||||
}
|
||||
_matrix_dream(m, mdb.CREATE, kit.Simple(m.OptionSimple(mdb.ICONS, nfs.REPOS, nfs.BINARY))...)
|
||||
_matrix_dream(m, cli.START)
|
||||
}},
|
||||
|
Loading…
x
Reference in New Issue
Block a user