From 7d7280d0fc4e2dae5a4ce24366a7f88c35352e5d Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 13 Oct 2022 17:46:14 -0300 Subject: [PATCH] feat: allow to parse from stdin (#559) Signed-off-by: Carlos A Becker Signed-off-by: Carlos A Becker --- nfpm.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nfpm.go b/nfpm.go index c7dbcda3..39ce9bdb 100644 --- a/nfpm.go +++ b/nfpm.go @@ -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) }