Skip to content

Instantly share code, notes, and snippets.

@mrunalp
Created July 19, 2017 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrunalp/65e858debc1960691731c68060e0368a to your computer and use it in GitHub Desktop.
Save mrunalp/65e858debc1960691731c68060e0368a to your computer and use it in GitHub Desktop.
diff --git a/cmd/kpod/load.go b/cmd/kpod/load.go
index ae346bc8..97783682 100644
--- a/cmd/kpod/load.go
+++ b/cmd/kpod/load.go
@@ -1,6 +1,8 @@
package main
import (
+ "fmt"
+ "os"
"github.com/containers/storage"
"github.com/pkg/errors"
"github.com/urfave/cli"
@@ -59,6 +61,19 @@ func loadCmd(c *cli.Context) error {
input := c.String("input")
quiet := c.Bool("quiet")
+ if input == "/dev/stdin" {
+ fi, err := os.Stdin.Stat()
+ if err != nil {
+ return err
+ }
+ if fi.Mode().IsRegular() {
+ fmt.Println("Loading from regular file")
+ } else {
+ fmt.Println("Loading from a pipe")
+ }
+ }
+
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment