Skip to content

Commit

Permalink
add posibilty to use kubectl convention of '-f -' to read stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Svensson committed Nov 23, 2023
1 parent 4b5c25a commit d864d3c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ func main() {
}
}
if fn != "" {
c, err := helpers.ReadYamlFileToStringArr(fn)
if err != nil {
fmt.Printf("unable to read file %v, quitting\n", fn)
os.Exit(2)
if fn == "-" {
stdin = true
} else {
c, err := helpers.ReadYamlFileToStringArr(fn)
if err != nil {
fmt.Printf("unable to read file %v, quitting\n", fn)
os.Exit(2)
}
y = c
}
y = c
}
if stdin {

Expand Down

0 comments on commit d864d3c

Please sign in to comment.