1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-29 18:39:21 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-03-02 10:01:36 +08:00
parent 4d1f2256fc
commit 5b0a86f019
2 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"os/signal" "os/signal"
"runtime"
"syscall" "syscall"
ice "shylinux.com/x/icebergs" ice "shylinux.com/x/icebergs"
@ -49,6 +50,9 @@ func init() {
Index.MergeCommands(ice.Commands{ Index.MergeCommands(ice.Commands{
SIGNAL: {Name: "signal signal auto listen", Help: "信号量", Actions: ice.MergeActions(ice.Actions{ SIGNAL: {Name: "signal signal auto listen", Help: "信号量", Actions: ice.MergeActions(ice.Actions{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
if runtime.GOOS == "windows" {
return
}
_signal_listen(m, 2, mdb.NAME, "重启", ice.CMD, "exit 1") _signal_listen(m, 2, mdb.NAME, "重启", ice.CMD, "exit 1")
_signal_listen(m, 3, mdb.NAME, "退出", ice.CMD, "exit 0") _signal_listen(m, 3, mdb.NAME, "退出", ice.CMD, "exit 0")
if f, p, e := logs.CreateFile(ice.Info.PidPath); e == nil { if f, p, e := logs.CreateFile(ice.Info.PidPath); e == nil {

View File

@ -215,11 +215,13 @@ func init() {
PULL: {Help: "下载", Hand: func(m *ice.Message, arg ...string) { PULL: {Help: "下载", Hand: func(m *ice.Message, arg ...string) {
_status_each(m, "", cli.SYSTEM, GIT, PULL) _status_each(m, "", cli.SYSTEM, GIT, PULL)
_status_each(m, "", cli.SYSTEM, GIT, PULL, "--tags") _status_each(m, "", cli.SYSTEM, GIT, PULL, "--tags")
m.Sleep("3s")
}}, }},
PUSH: {Help: "上传", Hand: func(m *ice.Message, arg ...string) { PUSH: {Help: "上传", Hand: func(m *ice.Message, arg ...string) {
if m.Option(REPOS) == "" { if m.Option(REPOS) == "" {
_status_each(m, "", cli.SYSTEM, GIT, PUSH) _status_each(m, "", cli.SYSTEM, GIT, PUSH)
_status_each(m, "", cli.SYSTEM, GIT, PUSH, "--tags") _status_each(m, "", cli.SYSTEM, GIT, PUSH, "--tags")
m.Sleep("3s")
return return
} }
m.Option(cli.CMD_DIR, _repos_path(m.Option(REPOS))) m.Option(cli.CMD_DIR, _repos_path(m.Option(REPOS)))