feat: add isDir template function (#1657)

This commit is contained in:
Simon Schröter
2024-08-06 21:39:00 +08:00
committed by GitHub
parent 5d8598a7d7
commit 505da8a31c
2 changed files with 26 additions and 0 deletions
+7
View File
@@ -39,6 +39,13 @@ The `isFile` function allows you to check if a file exists. On failure, the temp
{{ if isFile "./myfile" }}
```
#### `isDir`
The `isDir` function allows you to check if a directory exists. On failure, the template rendering will fail with an error message.
```yaml
{{ if isDir "./mydirectory" }}
```
#### `readFile`
The `readFile` function allows you to read a file and return its content as the function output. On failure, the template rendering will fail with an error message.