Skip to content

Commit

Permalink
Merge pull request #204 from carlossg/issue-184
Browse files Browse the repository at this point in the history
Do not use sdtin when directories are passed
  • Loading branch information
garethr authored Apr 14, 2020
2 parents bee8c2f + 8744b3d commit ed0bb9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ var RootCmd = &cobra.Command{
}
// We detect whether we have anything on stdin to process if we have no arguments
// or if the argument is a -
if (len(args) < 1 || args[0] == "-") && !windowsStdinIssue && ((stat.Mode() & os.ModeCharDevice) == 0) {
notty := (stat.Mode() & os.ModeCharDevice) == 0
noFileOrDirArgs := (len(args) < 1 || args[0] == "-") && len(directories) < 1
if noFileOrDirArgs && !windowsStdinIssue && notty {
var buffer bytes.Buffer
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
Expand Down

0 comments on commit ed0bb9a

Please sign in to comment.