simplify error check

This commit is contained in:
Shawn Smith
2015-10-03 16:55:39 +09:00
parent d2d5d31ee9
commit c6501ec0ef

View File

@@ -82,13 +82,16 @@ func clone(url string) error {
if err := cmd.Run(); err != nil {
return fmt.Errorf("could not run git clone: %v", err)
}
} else if err != nil {
return nil
}
if err != nil {
return fmt.Errorf("could not stat dir: %v", err)
} else {
cmd := exec.Command("git", "-C", dir, "pull")
if err := cmd.Run(); err != nil {
return fmt.Errorf("could not pull repo: %v", err)
}
}
cmd := exec.Command("git", "-C", dir, "pull")
if err := cmd.Run(); err != nil {
return fmt.Errorf("could not pull repo: %v", err)
}
return nil