Created
July 19, 2017 14:30
-
-
Save mrunalp/65e858debc1960691731c68060e0368a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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