Skip to content

Commit 948a5c8

Browse files
feat: pipe git clone output (#32)
Displays git clone command output to user using sesh
1 parent 7be8ff1 commit 948a5c8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git/clone.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package git
22

33
import (
4+
"os"
45
"os/exec"
56
"regexp"
67
"strings"
@@ -26,8 +27,13 @@ func Clone(o CloneOptions) (ClonedRepo, error) {
2627
if o.CmdDir != nil && strings.TrimSpace(*o.CmdDir) != "" {
2728
cmd.Dir = *o.CmdDir
2829
}
29-
_, err := cmd.Output()
30-
cmd.Wait()
30+
31+
cmd.Stdin = os.Stdin
32+
cmd.Stderr = os.Stderr
33+
cmd.Stdout = os.Stdout
34+
cmd.Env = os.Environ()
35+
36+
err := cmd.Run()
3137
if err != nil {
3238
return ClonedRepo{}, err
3339
}

0 commit comments

Comments
 (0)