1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00

opt nfs.git.sum

This commit is contained in:
shaoying 2019-09-21 18:45:11 +08:00
parent ac2a42a6fd
commit 447dba33c2
3 changed files with 11 additions and 5 deletions

View File

@ -853,7 +853,11 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
case "trend":
// 提交记录
m.Cmdy("nfs.git", "sum", "-n", kit.Select("20", arg, 1))
if len(arg) == 1 {
m.Cmdy("nfs.git", "sum", "-n", 20)
} else {
m.Cmdy("nfs.git", "sum", "-n", arg[1:])
}
case "submit":
// 提交代码

View File

@ -4,5 +4,5 @@ var version = struct {
host string
self int
}{
"2019-09-21 18:02:29", "mac", 621,
"2019-09-21 18:43:47", "mac", 626,
}

View File

@ -715,7 +715,7 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
if m.Options("git_dir") {
args = append(args, "-C", m.Option("git_dir"))
}
if args = append(args, "log", "--shortstat", "--pretty=commit: %ad", "--date=iso"); len(arg) > 1 {
if args = append(args, "log", "--shortstat", "--pretty=commit: %ad %n%s", "--date=iso"); len(arg) > 1 {
args = append(args, arg[1:]...)
} else {
args = append(args, "--reverse")
@ -723,8 +723,8 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
if out, e := exec.Command("git", args...).CombinedOutput(); e == nil {
for _, v := range strings.Split(string(out), "commit: ") {
if l := strings.Split(v, "\n"); len(l) > 2 {
fs := strings.Split(strings.TrimSpace(l[2]), ", ")
if l := strings.Split(v, "\n"); len(l) > 3 {
fs := strings.Split(strings.TrimSpace(l[3]), ", ")
hs := strings.Split(l[0], " ")
m.Add("append", "date", hs[0])
@ -739,6 +739,7 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
m.Add("append", "adds", "0")
m.Add("append", "dels", adds[0])
}
m.Add("append", "note", l[1])
m.Add("append", "hour", strings.Split(hs[1], ":")[0])
m.Add("append", "time", hs[1])
} else if len(l[0]) > 0 {
@ -746,6 +747,7 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
m.Add("append", "date", hs[0])
m.Add("append", "adds", 0)
m.Add("append", "dels", 0)
m.Add("append", "note", l[1])
m.Add("append", "hour", strings.Split(hs[1], ":")[0])
m.Add("append", "time", hs[1])
}