diff --git a/hcl2template/function/templatedir.go b/hcl2template/function/templatedir.go deleted file mode 100644 index 351cda13c..000000000 --- a/hcl2template/function/templatedir.go +++ /dev/null @@ -1,18 +0,0 @@ -package function - -import ( - "github.com/zclconf/go-cty/cty" - "github.com/zclconf/go-cty/cty/function" -) - -// MakeTemplateDirFunc constructs a function that returns the directory -// in which the configuration file is located. -func MakeTemplateDirFunc(baseDir string) function.Function { - return function.New(&function.Spec{ - Params: []function.Parameter{}, - Type: function.StaticReturnType(cty.String), - Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { - return cty.StringVal(baseDir), nil - }, - }) -} diff --git a/hcl2template/functions.go b/hcl2template/functions.go index 6af63c559..4ae0fa862 100644 --- a/hcl2template/functions.go +++ b/hcl2template/functions.go @@ -94,7 +94,6 @@ func Functions(basedir string) map[string]function.Function { "split": stdlib.SplitFunc, "strrev": stdlib.ReverseFunc, "substr": stdlib.SubstrFunc, - "template_dir": pkrfunction.MakeTemplateDirFunc(basedir), "timestamp": pkrfunction.TimestampFunc, "timeadd": stdlib.TimeAddFunc, "title": stdlib.TitleFunc, diff --git a/website/data/docs-navigation.js b/website/data/docs-navigation.js index 5afb3d00a..ebea2b6f9 100644 --- a/website/data/docs-navigation.js +++ b/website/data/docs-navigation.js @@ -113,7 +113,6 @@ export default [ 'fileset', 'pathexpand', 'pwd', - 'template_dir', ], }, { diff --git a/website/pages/docs/from-1.5/functions/file/template_dir.mdx b/website/pages/docs/from-1.5/functions/file/template_dir.mdx deleted file mode 100644 index ecad93176..000000000 --- a/website/pages/docs/from-1.5/functions/file/template_dir.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -layout: docs -page_title: template_dir - Functions - Configuration Language -sidebar_title: template_dir -description: The template_dir function returns the directory in which the configuration file is located. ---- - -# `template_dir` Function - -`template_dir` returns the directory in which the configuration file is located. - -```hcl -template_dir() -``` - -## Examples - -```shell-session -> template_dir() -packer -```