MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / ParseVariableStringArray

Function ParseVariableStringArray

pkg/executionscommon/executionscommon.go:304–314  ·  view source on GitHub ↗
(variables []string)

Source from the content-addressed store, hash-verified

302}
303
304func ParseVariableStringArray(variables []string) (map[string]string, error) {
305 result := make(map[string]string, len(variables))
306 for _, v := range variables {
307 components := splitVariableString(v, 2)
308 if len(components) != 2 || components[0] == "" || components[1] == "" {
309 return nil, fmt.Errorf("could not parse variable definition '%s'", v)
310 }
311 result[strings.TrimSpace(components[0])] = strings.TrimSpace(components[1])
312 }
313 return result, nil
314}
315
316func ToVariableStringArray(variables map[string]string) []string {
317 result := make([]string, 0, len(variables))

Callers 3

deployRunFunction · 0.92
runbookRunFunction · 0.92

Calls 1

splitVariableStringFunction · 0.85

Tested by 1