Skip to content

Commit

Permalink
Merge pull request #3 from jakewarren/head
Browse files Browse the repository at this point in the history
prevent duplicate output for -I | --head
  • Loading branch information
rs committed Sep 6, 2018
2 parents c60bbf8 + b7dad50 commit b31350e
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 b31350e

Please sign in to comment.