forked from x/icebergs
add some
This commit is contained in:
parent
5b102c5d63
commit
4ba34ff106
@ -227,6 +227,10 @@ func init() {
|
||||
cli.START: {Name: "start dev proto host port=9020 nodename username usernick", Hand: func(m *ice.Message, arg ...string) { _serve_start(m) }},
|
||||
SERVE_START: {Hand: func(m *ice.Message, arg ...string) {
|
||||
kit.If(m.Option(ice.DEMO) == ice.TRUE, func() { m.Cmd(CHAT_HEADER, ice.DEMO) })
|
||||
switch cb := m.Optionv(SERVE_START).(type) {
|
||||
case func():
|
||||
cb()
|
||||
}
|
||||
m.Go(func() {
|
||||
ssh.PrintQRCode(m, tcp.PublishLocalhost(m, _serve_address(m)))
|
||||
cli.Opens(m, mdb.Config(m, cli.OPEN))
|
||||
|
@ -93,3 +93,13 @@ func Run(cb func(*WebView) ice.Any) {
|
||||
}
|
||||
kit.If(!view.Menu(), func() { view.navigate(ice.Pulse.Cmdv(web.SPIDE, ice.OPS, web.CLIENT_ORIGIN)) })
|
||||
}
|
||||
func RunServe() {
|
||||
kit.Setenv(cli.PATH, "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin")
|
||||
kit.Chdir(kit.HomePath(ice.CONTEXTS))
|
||||
wait := make(chan bool, 1)
|
||||
ice.Pulse.Optionv(web.SERVE_START, func() { wait <- true })
|
||||
go ice.Run(ice.SERVE, ice.START)
|
||||
defer ice.Pulse.Cmd(ice.EXIT)
|
||||
defer Run(nil)
|
||||
<-wait
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user