forked from x/ContextOS
tce add hook
This commit is contained in:
parent
f5ad8da0a5
commit
49317a3e5c
1
Makefile
1
Makefile
@ -8,6 +8,7 @@ install:
|
|||||||
@go get github.com/gomarkdown/markdown
|
@go get github.com/gomarkdown/markdown
|
||||||
go install $(BENCH)
|
go install $(BENCH)
|
||||||
@date
|
@date
|
||||||
|
bench web.code.counter nmake 1
|
||||||
|
|
||||||
install_all: install
|
install_all: install
|
||||||
touch etc/local.shy
|
touch etc/local.shy
|
||||||
|
@ -178,6 +178,6 @@ function! BenchCode(cmd, arg)
|
|||||||
exe "silent !bench web.code." . a:cmd . " " . join(a:arg, " ")
|
exe "silent !bench web.code." . a:cmd . " " . join(a:arg, " ")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" autocmd BufReadPost * call BenchCode("counter", ["nopen", 1])
|
autocmd BufReadPost * call BenchCode("counter", ["nopen", 1])
|
||||||
autocmd BufWritePost * call BenchCode("counter", ["nsave", 1])
|
autocmd BufWritePost * call BenchCode("counter", ["nsave", 1])
|
||||||
"}}}
|
"}}}
|
||||||
|
@ -107,6 +107,6 @@ bindkey -M vicmd j down-line-or-beginning-search
|
|||||||
bindkey -M vicmd k up-line-or-beginning-search
|
bindkey -M vicmd k up-line-or-beginning-search
|
||||||
|
|
||||||
preexec() {
|
preexec() {
|
||||||
bench web.code.counter nexec 1
|
bench web.code.counter nexec 1 >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
etc/exit.shy
Normal file
8
etc/exit.shy
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
source etc/exit_local.shy
|
||||||
|
|
||||||
|
~code
|
||||||
|
config save var/counter.json counter
|
||||||
|
~stdio
|
||||||
|
config save var/history.json history
|
||||||
|
return hello
|
||||||
|
|
@ -883,7 +883,7 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
|||||||
m.Append("objects", mem.HeapObjects)
|
m.Append("objects", mem.HeapObjects)
|
||||||
m.Table()
|
m.Table()
|
||||||
}},
|
}},
|
||||||
"develop": &ctx.Command{Name: "develop", Help: "develop", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
"windows": &ctx.Command{Name: "windows", Help: "windows", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
m.Append("nclient", strings.Count(m.Spawn().Cmd("system", "tmux", "list-clients").Result(0), "\n"))
|
m.Append("nclient", strings.Count(m.Spawn().Cmd("system", "tmux", "list-clients").Result(0), "\n"))
|
||||||
m.Append("nsession", strings.Count(m.Spawn().Cmd("system", "tmux", "list-sessions").Result(0), "\n"))
|
m.Append("nsession", strings.Count(m.Spawn().Cmd("system", "tmux", "list-sessions").Result(0), "\n"))
|
||||||
m.Append("nwindow", strings.Count(m.Spawn().Cmd("system", "tmux", "list-windows", "-a").Result(0), "\n"))
|
m.Append("nwindow", strings.Count(m.Spawn().Cmd("system", "tmux", "list-windows", "-a").Result(0), "\n"))
|
||||||
|
@ -1366,6 +1366,13 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
|
|||||||
args = append(args, arg[1:]...)
|
args = append(args, arg[1:]...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch c {
|
||||||
|
case "commit":
|
||||||
|
m.Find("web.code").Cmd("counter", "ncommit", 1)
|
||||||
|
case "push":
|
||||||
|
m.Find("web.code").Cmd("counter", "npush", 1)
|
||||||
|
}
|
||||||
|
|
||||||
m.Log("info", "cmd: %s %v", "git", ctx.Trans("-C", p, c, args))
|
m.Log("info", "cmd: %s %v", "git", ctx.Trans("-C", p, c, args))
|
||||||
msg := m.Sess("cli").Cmd("system", "git", "-C", p, c, args)
|
msg := m.Sess("cli").Cmd("system", "git", "-C", p, c, args)
|
||||||
m.Copy(msg, "result").Copy(msg, "append")
|
m.Copy(msg, "result").Copy(msg, "append")
|
||||||
|
@ -55,15 +55,15 @@ var Index = &ctx.Context{Name: "code", Help: "代码中心",
|
|||||||
"pre_run": true,
|
"pre_run": true,
|
||||||
"display_result": "",
|
"display_result": "",
|
||||||
},
|
},
|
||||||
map[string]interface{}{"name": "develop", "help": "develop", "template": "componet",
|
map[string]interface{}{"name": "windows", "help": "windows", "template": "componet",
|
||||||
"context": "cli", "command": "develop",
|
"context": "cli", "command": "windows",
|
||||||
"inputs": []interface{}{
|
"inputs": []interface{}{
|
||||||
map[string]interface{}{"type": "button", "label": "refresh"},
|
map[string]interface{}{"type": "button", "label": "refresh"},
|
||||||
},
|
},
|
||||||
"pre_run": true,
|
"pre_run": true,
|
||||||
"display_result": "",
|
"display_result": "",
|
||||||
},
|
},
|
||||||
map[string]interface{}{"name": "counter", "help": "counter", "template": "componet",
|
map[string]interface{}{"name": "develop", "help": "develop", "template": "componet",
|
||||||
"context": "web.code", "command": "config", "arguments": []interface{}{"counter"},
|
"context": "web.code", "command": "config", "arguments": []interface{}{"counter"},
|
||||||
"inputs": []interface{}{
|
"inputs": []interface{}{
|
||||||
map[string]interface{}{"type": "button", "label": "refresh"},
|
map[string]interface{}{"type": "button", "label": "refresh"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user