From 26eac927e70b630619adbe6eabf0ab631e763379 Mon Sep 17 00:00:00 2001 From: Jason Young Date: Mon, 1 Feb 2016 11:12:32 +0800 Subject: [PATCH] Move output to stdout --- envplate.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/envplate.go b/envplate.go index 70bba07..bc69d7d 100644 --- a/envplate.go +++ b/envplate.go @@ -96,8 +96,8 @@ func parse(file string) error { parsed := exp.ReplaceAllStringFunc(string(content), func(match string) string { var ( - esc, key, sep, def = capture(match) - value, keyDefined = env[key] + esc, key, sep, def = capture(match) + value, keyDefined = env[key] ) if len(esc)%2 == 1 { @@ -142,7 +142,10 @@ func parse(file string) error { }) if Config.DryRun { - Log(INFO, "Expanding all references in '%s' would look like this:\n%s", file, parsed) + Log(INFO, "Successfully expanding all references into stdout") + + fmt.Print(parsed) + } else { if Config.Backup {