From b40aaadbca3d02c22fa392faa1b281df7d1793d2 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 17 Dec 2018 14:36:45 -0800 Subject: [PATCH] bpmodify: add argument if it is missing before, adding to a list which had no entries would do nothing (and not throw any errors). Now it will create the list and add a single element as expected. Change-Id: I8c48a42303f7d9b3741868ad86097e2071ec434a --- bpmodify/bpmodify.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bpmodify/bpmodify.go b/bpmodify/bpmodify.go index 446034b..c0bf519 100644 --- a/bpmodify/bpmodify.go +++ b/bpmodify/bpmodify.go @@ -148,7 +148,14 @@ func processModule(module *parser.Module, moduleName string, } } - return false, nil + prop := parser.Property{Name: *parameter, Value: &parser.List{}} + modified, errs = processParameter(prop.Value, *parameter, moduleName, file) + + if modified { + module.Properties = append(module.Properties, &prop) + } + + return modified, errs } func processParameter(value parser.Expression, paramName, moduleName string,