|
|
|
|
@ -79,6 +79,7 @@ func Funcs() map[string]ast.Function {
|
|
|
|
|
"md5": interpolationFuncMd5(),
|
|
|
|
|
"merge": interpolationFuncMerge(),
|
|
|
|
|
"min": interpolationFuncMin(),
|
|
|
|
|
"pathexpand": interpolationFuncPathExpand(),
|
|
|
|
|
"uuid": interpolationFuncUUID(),
|
|
|
|
|
"replace": interpolationFuncReplace(),
|
|
|
|
|
"sha1": interpolationFuncSha1(),
|
|
|
|
|
@ -431,6 +432,17 @@ func interpolationFuncMin() ast.Function {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// interpolationFuncPathExpand will expand any `~`'s found with the full file path
|
|
|
|
|
func interpolationFuncPathExpand() ast.Function {
|
|
|
|
|
return ast.Function{
|
|
|
|
|
ArgTypes: []ast.Type{ast.TypeString},
|
|
|
|
|
ReturnType: ast.TypeString,
|
|
|
|
|
Callback: func(args []interface{}) (interface{}, error) {
|
|
|
|
|
return homedir.Expand(args[0].(string))
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// interpolationFuncCeil returns the the least integer value greater than or equal to the argument
|
|
|
|
|
func interpolationFuncCeil() ast.Function {
|
|
|
|
|
return ast.Function{
|
|
|
|
|
|