summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/main.go b/main.go
index 86b689d..9020aaa 100644
--- a/main.go
+++ b/main.go
@@ -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
}