From d092b1444a440a5c7ea5643d05e566bf2c91ed50 Mon Sep 17 00:00:00 2001 From: Mr Dung Date: Thu, 11 Mar 2021 23:56:54 +0700 Subject: [PATCH] refs run shell --- cmd/shell.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/shell.go b/cmd/shell.go index 1c49320..718e761 100644 --- a/cmd/shell.go +++ b/cmd/shell.go @@ -5,6 +5,7 @@ import ( "github.com/dung13890/deploy-tool/config" "github.com/dung13890/deploy-tool/remote" "github.com/urfave/cli/v2" + "io" "log" ) @@ -46,6 +47,15 @@ func (s *shell) exec() error { defer r.Close() fmt.Println("Running shell into multiple servers:") - + var writers []io.Writer + var input io.Reader + go func() { + writer := io.MultiWriter(writers...) + _, err := io.Copy(writer, input) + if err != nil { + log.Fatal(err) + } + fmt.Println(input) + }() return nil }