diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-11-26 15:22:40 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-11-26 15:22:40 +0100 |
commit | 8cf749bbc429dd4db71a37de663616bafb4f6480 (patch) | |
tree | f78bb37a5086a8bebf0380681a014cfb6d0598f2 /cmd | |
parent | 6e3ac6889f8fb25bcd4b4468745dc84c487d7a6e (diff) |
actually run the go commands
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/mt-build-plugin/build.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cmd/mt-build-plugin/build.go b/cmd/mt-build-plugin/build.go index 6364acc..4189a22 100644 --- a/cmd/mt-build-plugin/build.go +++ b/cmd/mt-build-plugin/build.go @@ -9,6 +9,7 @@ package main import ( "log" + "os" "os/exec" proxy "github.com/HimbeerserverDE/mt-multiserver-proxy" @@ -24,11 +25,21 @@ func main() { pathVer := "github.com/HimbeerserverDE/mt-multiserver-proxy@" + version - if err := exec.Command("go", "get", "-u", pathVer); err != nil { + if err := goCmd("get", "-u", pathVer); err != nil { log.Fatalln("error updating proxy dependency:", err) } - if err := exec.Command("go", "build", "-buildmode=plugin"); err != nil { + if err := goCmd("build", "-buildmode=plugin"); err != nil { log.Fatalln("error building plugin:", err) } } + +func goCmd(args ...string) error { + cmd := exec.Command("go", args...) + + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + + return cmd.Run() +} |