Use cmd.Run instead of cmd.Start+cmd.Wait.

This commit is contained in:
verytable 2020-02-02 01:21:12 +03:00
parent ff809b73c3
commit 664f66105b

View file

@ -131,12 +131,8 @@ func copyDir(src, dst string) {
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
if err := cmd.Start(); err != nil { if err := cmd.Run(); err != nil {
log.Fatalf("error starting rsync command: %s", err) log.Fatalf("directory copying failed: %s", err)
}
if err := cmd.Wait(); err != nil {
log.Fatalf("rsync command failed: %s", err)
} }
} }
@ -155,11 +151,7 @@ func copyFiles(baseDir string, relPaths []string, dst string) {
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
if err := cmd.Start(); err != nil { if err := cmd.Run(); err != nil {
log.Fatalf("error starting file copying: %s", err)
}
if err := cmd.Wait(); err != nil {
log.Fatalf("file copying failed: %s", err) log.Fatalf("file copying failed: %s", err)
} }
} }
@ -173,11 +165,7 @@ func runTests(testDir string) {
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
if err := cmd.Start(); err != nil { if err := cmd.Run(); err != nil {
log.Fatalf("error starting go test command: %s", err)
}
if err := cmd.Wait(); err != nil {
log.Fatalf("go test command failed: %s", err) log.Fatalf("go test command failed: %s", err)
} }
} }