mirror of
https://github.com/go-task/task.git
synced 2024-12-16 10:59:23 +02:00
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
|