1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-03-17 22:13:09 +08:00
parent 6cac11467e
commit b3a5b1052b
4 changed files with 37 additions and 4 deletions

View File

@ -1,5 +1,3 @@
//go:build !windows
package gdb
import (
@ -23,3 +21,4 @@ func SignalProcess(m *ice.Message, pid string) bool {
}
return false
}

23
base/gdb/signal_linux.go Normal file
View File

@ -0,0 +1,23 @@
package gdb
import (
"os"
"syscall"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/mdb"
kit "shylinux.com/x/toolkits"
)
func _signal_init(m *ice.Message, arg ...string) {
_signal_listen(m, 1, mdb.NAME, START, ice.CMD, "runtime")
_signal_listen(m, 2, mdb.NAME, RESTART, ice.CMD, "exit 1")
_signal_listen(m, 3, mdb.NAME, STOP, ice.CMD, "exit 0")
_signal_listen(m, int(syscall.SIGUSR1), mdb.NAME, "info", ice.CMD, "runtime")
}
func SignalProcess(m *ice.Message, pid string) bool {
if proc, err := os.FindProcess(kit.Int(pid)); err == nil && proc.Signal(syscall.SIGUSR1) == nil {
return true
}
return false
}

View File

@ -96,9 +96,13 @@ func _dir_list(m *ice.Message, root string, dir string, level int, deep bool, di
case mdb.LINK:
if isDir {
m.Push(mdb.LINK, "")
} else {
if strings.Contains(p, "ice.windows") {
m.PushDownload(mdb.LINK, "ice.exe", p)
} else {
m.PushDownload(mdb.LINK, p)
}
}
case mdb.SHOW:
switch p := m.MergeLink(SHARE_LOCAL+p, ice.POD, m.Option(ice.MSG_USERPOD)); kit.Ext(s.Name()) {
case PNG, JPG:

View File

@ -3,6 +3,7 @@ package code
import (
"encoding/base64"
"path"
"runtime"
"strings"
ice "shylinux.com/x/icebergs"
@ -178,7 +179,13 @@ func init() {
}
} else {
kit.If(m.Length() == 0, func() {
kit.If(arg[0] == cli.SH, func() { arg[0] = cli.Shell(m) })
kit.If(arg[0] == cli.SH, func() {
if runtime.GOOS == cli.WINDOWS {
arg[0] = "ish"
} else {
arg[0] = cli.Shell(m)
}
})
arg[0] = m.Cmdx("", mdb.CREATE, arg)
mdb.HashSelect(m, arg[0])
})