Skip to content

Commit 808a5c9

Browse files
committed
docs: if and try
1 parent 69301ab commit 808a5c9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/guide/intro/extensions.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,28 @@ The user will be required to unlock their keychain if the secret-agent isn't run
127127
password: 'enc:1:wy4ECQMI/o7E3nw9SP7g3VsIMg64HGIcRb9HyaXpQnyjozFItwx4HvsP1D2plP6Y0kYBAr2ytzs2v5bN+n2oVthkEmbrq8oqIqCF3Cx+pcjJ+5h+SyxQuJ7neNp4SRtnD4EK32rPJpyDMeHG4+pGwIjFuSH1USqQ=SZWR'
128128
```
129129

130+
## The `$if` and `$try` Directives
131+
132+
Performs basic control flow.
133+
134+
```yaml
135+
$try:
136+
$value:
137+
$extends: ./other-file.yml
138+
$fallback: {}
139+
```
140+
141+
Use `$unsafe: true` if you want to catch _any_ error. Some "safe" errors are caught by default.
142+
143+
```yaml
144+
$if:
145+
$check: true
146+
$then: foo
147+
$else: bar
148+
```
149+
150+
The `$if` directive is straightforward, see the example.
151+
130152
## The `$timestamp` Directive
131153

132154
Allows injecting the current date and time into configuration. While this option is useful,

0 commit comments

Comments
 (0)