-
-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added suport for multiline variables from sh
Instead of giving an error on multiline results from sh, the results are now concatenated to one line by default, separated by a single space. Trailing and leading white space are stripped like before. In adition, some flags have been added for advanced use cases to turn off line concationaton and/or trimming off leading/trailing white-space.
- Loading branch information
Showing
4 changed files
with
187 additions
and
66 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
default: | ||
vars: | ||
MULTILINE: "\n\nfoo\n bar\nfoobar\n\nbaz\n\n" | ||
cmds: | ||
- task: file | ||
vars: | ||
CONTENT: | ||
sh: "echo -n 'foo\nbar'" | ||
FILE: "echo_nocache.txt" | ||
- task: file | ||
vars: | ||
CONTENT: | ||
sh: "echo -n 'foo\nbar'" | ||
multiline: true | ||
FILE: "echo_cache.txt" | ||
- task: file | ||
vars: | ||
CONTENT: "{{.MULTILINE}}" | ||
FILE: "var_multiline.txt" | ||
- task: file | ||
vars: | ||
CONTENT: | ||
sh: "echo -n '{{.MULTILINE}}'" | ||
FILE: "sh_default.txt" | ||
- task: file | ||
vars: | ||
CONTENT: | ||
sh: "echo -n '{{.MULTILINE}}'" | ||
notrim: true | ||
FILE: "sh_notrim.txt" | ||
- task: file | ||
vars: | ||
CONTENT: | ||
sh: "echo -n '{{.MULTILINE}}'" | ||
multiline: true | ||
FILE: "sh_multiline.txt" | ||
- task: file | ||
vars: | ||
CONTENT: | ||
sh: "echo -n '{{.MULTILINE}}'" | ||
multiline: true | ||
notrim: true | ||
FILE: "sh_multiline_notrim.txt" | ||
|
||
file: | ||
cmds: | ||
- | | ||
cat << EOF > '{{.FILE}}' | ||
{{.CONTENT}} | ||
EOF |
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