Skip to content

Commit

Permalink
feat: Show cmd stdOut and stdErr on verbose/debug
Browse files Browse the repository at this point in the history
Only shows git command stdOut and stdErr when ran with the verbose or
debug flags.

Co-authored-by: ArkStructCodes
<[email protected]>
Signed-off-by: AlexNg <[email protected]>
  • Loading branch information
caffeine-addictt committed Sep 7, 2024
1 parent 8e78268 commit 28db085
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/options/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ func (o *NewOptions) CloneRepo() (string, error) {

c := exec.Command("git", args...)
c.Stdin = os.Stdin
c.Stdout = os.Stdout
c.Stderr = os.Stderr

if GlobalOpts.DebugOrVerbose() {
c.Stdout = os.Stdout
c.Stderr = os.Stderr
}

if err := c.Run(); err != nil {
if errCleanup := os.RemoveAll(tmpDirPath); errCleanup != nil {
Expand Down

0 comments on commit 28db085

Please sign in to comment.