Skip to content

Commit

Permalink
Fix stdin bug with windows git bash (#403)
Browse files Browse the repository at this point in the history
* Fix stdin bug with windows git bash

* Misc update
  • Loading branch information
RamanaReddy0M authored May 6, 2024
1 parent 1e40ad2 commit c227e51
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import (
"time"

"github.com/asaskevich/govalidator"
"github.com/mattn/go-isatty"
"github.com/pkg/errors"
osutils "github.com/projectdiscovery/utils/os"
sliceutil "github.com/projectdiscovery/utils/slice"
stringsutil "github.com/projectdiscovery/utils/strings"
"gopkg.in/yaml.v3"
Expand Down Expand Up @@ -177,6 +179,9 @@ func CreateFolder(path string) error {

// HasStdin determines if the user has piped input
func HasStdin() bool {
if osutils.IsWindows() && (isatty.IsTerminal(os.Stdin.Fd()) || isatty.IsCygwinTerminal(os.Stdin.Fd())) {
return false
}
stat, err := os.Stdin.Stat()
if err != nil {
return false
Expand Down

0 comments on commit c227e51

Please sign in to comment.