Skip to content

Commit

Permalink
feat: allow to parse from stdin (#559)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 authored Oct 13, 2022
1 parent 249917d commit 7d7280d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nfpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func ParseWithEnvMapping(in io.Reader, mapping func(string) string) (config Conf

// ParseFile decodes YAML data from a file path into a configuration struct.
func ParseFile(path string) (config Config, err error) {
if path == "-" {
return ParseWithEnvMapping(os.Stdin, os.Getenv)
}
return ParseFileWithEnvMapping(path, os.Getenv)
}

Expand Down

0 comments on commit 7d7280d

Please sign in to comment.