From 4d422f8efb565ba5fb818f38e11cd1dcfdf8c19c Mon Sep 17 00:00:00 2001 From: shaoying Date: Tue, 15 May 2018 20:42:00 +0800 Subject: [PATCH] tce add nfs.git --- etc/init.shy | 2 +- src/contexts/nfs/nfs.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/etc/init.shy b/etc/init.shy index f35290f2..e7343d81 100644 --- a/etc/init.shy +++ b/etc/init.shy @@ -2,6 +2,6 @@ login root root ~ssh - config domain ctx + config domain tce dial "shylinux.com:9090" diff --git a/src/contexts/nfs/nfs.go b/src/contexts/nfs/nfs.go index 41b906a0..577cd5aa 100644 --- a/src/contexts/nfs/nfs.go +++ b/src/contexts/nfs/nfs.go @@ -11,6 +11,7 @@ import ( // {{{ "io" "net/url" "os" + "os/exec" "strconv" "strings" "unicode" @@ -946,6 +947,15 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心", m.Assert(e) m.Echo(wd) // }}} }}, + "git": &ctx.Command{Name: "git", Help: "写入文件, string: 写入内容, pos: 写入位置", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) { + cmd := exec.Command("git", arg...) + if out, e := cmd.CombinedOutput(); e != nil { + m.Echo("error: ") + m.Echo("%s\n", e) + } else { + m.Echo(string(out)) + } + }}, }, Index: map[string]*ctx.Context{ "void": &ctx.Context{Name: "void",