diff options
-rw-r--r-- | main.go | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -36,9 +36,12 @@ func main() { } } -func runCommand(name string, args ...string) { +func runCommand(dir string, name string, args ...string) { log.Printf("%s %s\n", name, strings.Join(args, " ")) command := exec.Command(name, args...) + command.Dir = dir + command.Stderr = os.Stderr + command.Stdout = os.Stdout err := command.Run() if err != nil { log.Fatal(err) @@ -53,6 +56,7 @@ func prepareWorkbench(repo string, commit string) string { defer os.RemoveAll(workbench) runCommand( + workbench, "git", "clone", repo, @@ -60,6 +64,7 @@ func prepareWorkbench(repo string, commit string) string { ) runCommand( + workbench, "git", "--git-dir", filepath.Join(workbench, ".git"), @@ -69,6 +74,19 @@ func prepareWorkbench(repo string, commit string) string { commit, ) + runCommand( + workbench, + "git", + "--git-dir", + filepath.Join(workbench, ".git"), + "--work-tree", + workbench, + "submodule", + "update", + "--init", + "--recursive", + ) + return workbench } |