github.com/fnproject/cli@v0.0.0-20240508150455-e5d88bd86117/commands/invoke_others.go (about)

     1  //go:build !windows
     2  // +build !windows
     3  
     4  package commands
     5  
     6  import (
     7  	"io"
     8  	"os"
     9  )
    10  
    11  func stdin() io.Reader {
    12  	stat, err := os.Stdin.Stat()
    13  	if err != nil || (stat.Mode()&os.ModeCharDevice) != 0 {
    14  		return nil
    15  	}
    16  	return os.Stdin
    17  }