-
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 f0cc511
Showing
6 changed files
with
35 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
18 changes: 18 additions & 0 deletions
18
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,18 @@ | ||
# `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 *args* to be | ||
created programmatically. | ||
|
||
!!! example | ||
|
||
``` | ||
{{- $args := (list "config" "current-context") }} | ||
current-context: {{ outputList "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