From 914ed2ba902ddd807088bf6f56fa0790701d4fc4 Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Thu, 20 Oct 2016 19:16:56 +0530 Subject: [PATCH] Allow 'secrets' and 'vars' to be blank --- main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 2669980..7774edd 100644 --- a/main.go +++ b/main.go @@ -93,12 +93,16 @@ func run(c *cli.Context) error { json.Unmarshal([]byte(c.String("terraform.remote")), &remote) var vars map[string]string - if err := json.Unmarshal([]byte(c.String("terraform.vars")), &vars); err != nil { - panic(err) + if c.String("terraform.vars") != "" { + if err := json.Unmarshal([]byte(c.String("terraform.vars")), &vars); err != nil { + panic(err) + } } var secrets map[string]string - if err := json.Unmarshal([]byte(c.String("terraform.secrets")), &secrets); err != nil { - panic(err) + if c.String("terraform.secrets") != "" { + if err := json.Unmarshal([]byte(c.String("terraform.secrets")), &secrets); err != nil { + panic(err) + } } plugin := Plugin{