mirror of
https://github.com/go-task/task.git
synced 2024-12-14 10:52:43 +02:00
3556942516
Closes #76 #89 #77 #83
44 lines
945 B
YAML
44 lines
945 B
YAML
default:
|
|
vars:
|
|
MULTILINE: "\n\nfoo\n bar\nfoobar\n\nbaz\n\n"
|
|
cmds:
|
|
- task: file
|
|
vars:
|
|
CONTENT:
|
|
sh: "echo 'foo\nbar'"
|
|
FILE: "echo_foobar.txt"
|
|
- task: file
|
|
vars:
|
|
CONTENT:
|
|
sh: "echo -n 'foo\nbar'"
|
|
FILE: "echo_n_foobar.txt"
|
|
- task: file
|
|
vars:
|
|
CONTENT:
|
|
sh: echo -n "{{.MULTILINE}}"
|
|
FILE: "echo_n_multiline.txt"
|
|
- task: file
|
|
vars:
|
|
CONTENT: "{{.MULTILINE}}"
|
|
FILE: "var_multiline.txt"
|
|
- task: file
|
|
vars:
|
|
CONTENT: "{{.MULTILINE | catLines}}"
|
|
FILE: "var_catlines.txt"
|
|
- task: enumfile
|
|
vars:
|
|
LINES: "{{.MULTILINE}}"
|
|
FILE: "var_enumfile.txt"
|
|
file:
|
|
cmds:
|
|
- |
|
|
cat << EOF > '{{.FILE}}'
|
|
{{.CONTENT}}
|
|
EOF
|
|
enumfile:
|
|
cmds:
|
|
- |
|
|
cat << EOF > '{{.FILE}}'
|
|
{{range $i, $line := .LINES| splitLines}}{{$i}}:{{$line}}
|
|
{{end}}EOF
|