mirror of https://github.com/hashicorp/packer
parent
13118692cc
commit
44dfa221de
@ -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
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -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
|
||||
```
|
||||
Loading…
Reference in new issue