Skip to content

Commit 73aae68

Browse files
committed
docs(plg): document INLINE exit code behavior and min/max gating
Add warning that any non-zero exit from an <INLINE> block aborts plugin installation. Add examples for version-gating <FILE> sections with min/max attributes for conditional execution by OS version. Thanks @Squidly271 in issue #2
1 parent 9dbc775 commit 73aae68

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

docs/plg-file.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,38 @@ echo "Done!"
186186
</FILE>
187187
```
188188

189+
{: .warning }
190+
> Any non-zero exit code from an `<INLINE>` block aborts installation/update. If your script may hit non-fatal failures, handle them and end with a successful exit status.
191+
192+
```xml
193+
<FILE Run="/bin/bash">
194+
<INLINE>
195+
set +e
196+
some_optional_command || true
197+
echo "Continuing install"
198+
exit 0
199+
</INLINE>
200+
</FILE>
201+
```
202+
203+
### Version-Gated Sections with `min` and `max`
204+
205+
Individual `<FILE>` sections support `min` and `max` attributes to conditionally execute or download based on OS version.
206+
207+
```xml
208+
<!-- Only processed on Unraid 7.0.0+ -->
209+
<FILE Name="/boot/config/plugins/myplugin/newer-only.txz" min="7.0.0">
210+
<URL>https://example.com/newer-only.txz</URL>
211+
</FILE>
212+
213+
<!-- Only processed on Unraid 6.12.x and below -->
214+
<FILE Run="/bin/bash" max="6.12.99">
215+
<INLINE>
216+
echo "Legacy compatibility step"
217+
</INLINE>
218+
</FILE>
219+
```
220+
189221
### Using LOCAL for Caching
190222

191223
The `<LOCAL>` element copies a previously downloaded file:

0 commit comments

Comments
 (0)