1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +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"
"os"
"os/signal"
"runtime"
"syscall"
ice "shylinux.com/x/icebergs"
@ -49,6 +50,9 @@ func init() {
Index.MergeCommands(ice.Commands{
SIGNAL: {Name: "signal signal auto listen", Help: "信号量", Actions: ice.MergeActions(ice.Actions{
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, 3, mdb.NAME, "退出", ice.CMD, "exit 0")
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) {
_status_each(m, "", cli.SYSTEM, GIT, PULL)
_status_each(m, "", cli.SYSTEM, GIT, PULL, "--tags")
m.Sleep("3s")
}},
PUSH: {Help: "上传", Hand: func(m *ice.Message, arg ...string) {
if m.Option(REPOS) == "" {
_status_each(m, "", cli.SYSTEM, GIT, PUSH)
_status_each(m, "", cli.SYSTEM, GIT, PUSH, "--tags")
m.Sleep("3s")
return
}
m.Option(cli.CMD_DIR, _repos_path(m.Option(REPOS)))