-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add outputList template function
Resolves #4253
- Loading branch information
1 parent
9075fec
commit ce88aac
Showing
6 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
assets/chezmoi.io/docs/reference/templates/functions/outputList.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# `outputList` *name* [*argList*] | ||
|
||
`outputList` returns the output of executing the command _name_ with the *argList*. | ||
*arg*s. If executing the command returns an error then template execution exits | ||
with an error. The execution occurs every time that the template is executed. It | ||
is the user's responsibility to ensure that executing the command is both | ||
idempotent and fast. | ||
|
||
This differs from [`output`](output.md) in that it allows for the `outputList` | ||
to be created programmatically. The list *must* be converted to a string list | ||
with `toStrings`. | ||
|
||
!!! example | ||
|
||
``` | ||
{{- $args := (list "config" "current-context") | toStrings }} | ||
current-context: {{ output "kubectl" $args | trim }} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters