mirror of
https://shylinux.com/x/icebergs
synced 2025-04-29 18:39:21 +08:00
opt some
This commit is contained in:
parent
4d1f2256fc
commit
5b0a86f019
@ -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 {
|
||||||
|
@ -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)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user