From 096925b2eb50e5241bd305bfce044a7c1a65f706 Mon Sep 17 00:00:00 2001 From: ctfang <2206582181@qq.com> Date: Sun, 10 Apr 2022 13:06:24 +0800 Subject: [PATCH] dev --- console/commands/dev.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/console/commands/dev.go b/console/commands/dev.go index f7965e8..4af8700 100644 --- a/console/commands/dev.go +++ b/console/commands/dev.go @@ -3,7 +3,7 @@ package commands import ( "fmt" "github.com/ctfang/command" - "log" + "os" "os/exec" ) @@ -24,16 +24,16 @@ func (DevCommand) Execute(input command.Input) { runOtherCommand("toolset", "make:route", "-root="+root) runOtherCommand("toolset", "make:orm", "-root="+root) runOtherCommand("toolset", "make:bean", "-root="+root) + runOtherCommand("go", "run", root+"/main.go") } func runOtherCommand(name string, arg ...string) { cmd := exec.Command(name, arg...) - out, err := cmd.CombinedOutput() + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Run() if err != nil { - fmt.Printf("combined out:\n%s\n", string(out)) - log.Fatalf("cmd.Run() failed with %s\n", err) - } - if len(out) > 0 { - fmt.Printf("\n%s\n", string(out)) + fmt.Println("cmd.Output: ", err) + return } }