Skip to content

Commit

Permalink
prevent duplicate output for -I | --head
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewarren committed Sep 6, 2018
1 parent c60bbf8 commit b7dad50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"strings"
Expand Down Expand Up @@ -98,6 +99,9 @@ func main() {
Verbose: verbose,
Post: input,
}
if (opts.Has("I") || opts.Has("head")) && terminal.IsTerminal(1) {
cmd.Stdout = ioutil.Discard
}
status := 0
if err := cmd.Run(); err != nil {
switch err := err.(type) {
Expand Down

0 comments on commit b7dad50

Please sign in to comment.