helper/config: copy buildname/buildtype properly
This commit is contained in:
parent
8fd673ff9f
commit
fd2d44c212
|
@ -42,6 +42,8 @@ func Decode(target interface{}, config *DecodeOpts, raws ...interface{}) error {
|
||||||
if config.InterpolateContext == nil {
|
if config.InterpolateContext == nil {
|
||||||
config.InterpolateContext = ctx
|
config.InterpolateContext = ctx
|
||||||
} else {
|
} else {
|
||||||
|
config.InterpolateContext.BuildName = ctx.BuildName
|
||||||
|
config.InterpolateContext.BuildType = ctx.BuildType
|
||||||
config.InterpolateContext.TemplatePath = ctx.TemplatePath
|
config.InterpolateContext.TemplatePath = ctx.TemplatePath
|
||||||
config.InterpolateContext.UserVariables = ctx.UserVariables
|
config.InterpolateContext.UserVariables = ctx.UserVariables
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ func funcGenBuildName(ctx *Context) interface{} {
|
||||||
func funcGenBuildType(ctx *Context) interface{} {
|
func funcGenBuildType(ctx *Context) interface{} {
|
||||||
return func() (string, error) {
|
return func() (string, error) {
|
||||||
if ctx == nil || ctx.BuildType == "" {
|
if ctx == nil || ctx.BuildType == "" {
|
||||||
return "", errors.New("build_name not available")
|
return "", errors.New("build_type not available")
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.BuildType, nil
|
return ctx.BuildType, nil
|
||||||
|
|
Loading…
Reference in New Issue