diff --git a/hcl2template/function/pwd.go b/hcl2template/function/pwd.go deleted file mode 100644 index 64948d838..000000000 --- a/hcl2template/function/pwd.go +++ /dev/null @@ -1,20 +0,0 @@ -package function - -import ( - "os" - - "github.com/zclconf/go-cty/cty" - "github.com/zclconf/go-cty/cty/function" -) - -// MakePwdFunc constructs a function that returns the working directory as a string. -func MakePwdFunc() 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) { - dir, err := os.Getwd() - return cty.StringVal(dir), err - }, - }) -} diff --git a/hcl2template/functions.go b/hcl2template/functions.go index 4ae0fa862..821c525ba 100644 --- a/hcl2template/functions.go +++ b/hcl2template/functions.go @@ -76,7 +76,6 @@ func Functions(basedir string) map[string]function.Function { "parseint": stdlib.ParseIntFunc, "pathexpand": filesystem.PathExpandFunc, "pow": stdlib.PowFunc, - "pwd": pkrfunction.MakePwdFunc(), "range": stdlib.RangeFunc, "reverse": stdlib.ReverseFunc, "replace": stdlib.ReplaceFunc, diff --git a/website/data/docs-navigation.js b/website/data/docs-navigation.js index ebea2b6f9..e0ceac5a7 100644 --- a/website/data/docs-navigation.js +++ b/website/data/docs-navigation.js @@ -112,7 +112,6 @@ export default [ 'fileexists', 'fileset', 'pathexpand', - 'pwd', ], }, { diff --git a/website/pages/docs/from-1.5/functions/file/pwd.mdx b/website/pages/docs/from-1.5/functions/file/pwd.mdx deleted file mode 100644 index ef2bafe28..000000000 --- a/website/pages/docs/from-1.5/functions/file/pwd.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -layout: docs -page_title: pwd - Functions - Configuration Language -sidebar_title: pwd -description: The pwd function returns the working directory while executing Packer. ---- - -# `pwd` Function - -`pwd` returns the working directory while executing Packer. - -```hcl -pwd() -``` - -## Examples - -```shell-session -> pwd() -/home/user/some/packer -```