2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-06-23 22:02:25 +00:00

refactoring: explicit docker commands

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-04-24 16:27:04 +02:00
parent 20ba409039
commit 085e57a07a
6 changed files with 54 additions and 22 deletions

View File

@ -29,6 +29,14 @@ var (
CommandContext = exec.CommandContext
)
func SetDebug(debug bool) {
if debug {
Run = RunStdout
} else {
Run = RunNoOut
}
}
func RunStdout(ctx context.Context, c string, args ...string) error {
cmd := exec.CommandContext(ctx, c, args...)
cmd.Stdout = os.Stdout