Goctl rpc patch (#117)

* remove mock generation

* add: proto project import

* update document

* remove mock generation

* add: proto project import

* update document

* remove NL

* update document

* optimize code

* add test

* add test
This commit is contained in:
Keson
2020-10-10 16:19:46 +08:00
committed by GitHub
parent c32759d735
commit 0a9c427443
26 changed files with 1394 additions and 230 deletions

View File

@@ -6,15 +6,17 @@ import (
"fmt"
"os/exec"
"runtime"
"github.com/tal-tech/go-zero/tools/goctl/vars"
)
func Run(arg string, dir string) (string, error) {
goos := runtime.GOOS
var cmd *exec.Cmd
switch goos {
case "darwin", "linux":
case vars.OsMac, vars.OsLinux:
cmd = exec.Command("sh", "-c", arg)
case "windows":
case vars.OsWindows:
cmd = exec.Command("cmd.exe", "/c", arg)
default:
return "", fmt.Errorf("unexpected os: %v", goos)