mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
add some
This commit is contained in:
parent
6cac11467e
commit
b3a5b1052b
@ -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
23
base/gdb/signal_linux.go
Normal 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
|
||||
}
|
@ -97,7 +97,11 @@ func _dir_list(m *ice.Message, root string, dir string, level int, deep bool, di
|
||||
if isDir {
|
||||
m.Push(mdb.LINK, "")
|
||||
} else {
|
||||
m.PushDownload(mdb.LINK, p)
|
||||
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()) {
|
||||
|
@ -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])
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user