mirror of https://github.com/databricks/cli.git
fix: Cleanup
This commit is contained in:
parent
66dae816ab
commit
d0db1d73f9
|
@ -264,11 +264,12 @@ func (r *Root) InitializeVariables(vars []string) error {
|
||||||
// Variables can have any type of value, including complex types
|
// Variables can have any type of value, including complex types
|
||||||
func (r *Root) InitializeAnyTypeVariables(vars map[string]any) error {
|
func (r *Root) InitializeAnyTypeVariables(vars map[string]any) error {
|
||||||
for name, val := range vars {
|
for name, val := range vars {
|
||||||
if _, ok := r.Variables[name]; !ok {
|
variable, ok := r.Variables[name]
|
||||||
|
if !ok {
|
||||||
return fmt.Errorf("variable %s has not been defined", name)
|
return fmt.Errorf("variable %s has not been defined", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := r.Variables[name].Set(val)
|
err := variable.Set(val)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to assign %s to %s: %s", val, name, err)
|
return fmt.Errorf("failed to assign %s to %s: %s", val, name, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue