Skip to content

Commit e2613f3

Browse files
committed
[feat]:add export cmd for export the yaml that tools-v2 used
Signed-off-by: youarefree123 <[email protected]>
1 parent 6e7173c commit e2613f3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/variable/variables.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,15 @@ func (vars *Variables) Rendering(s string) (string, error) {
139139
return s, nil
140140
}
141141

142+
var err error
142143
value := vars.r.ReplaceAllStringFunc(s, func(name string) string {
143-
val, _ := vars.Get(name[2 : len(name)-1])
144+
val, e := vars.Get(name[2 : len(name)-1])
145+
if e != nil && err == nil {
146+
err = e
147+
}
144148
return val
145149
})
146-
return value, nil
150+
return value, err
147151
}
148152

149153
func (vars *Variables) Debug() {

0 commit comments

Comments
 (0)