mirror of
https://github.com/go-task/task.git
synced 2025-01-30 05:39:17 +02:00
59d2733b88
It was always running in the main Taskfile dir, even when the variable was declared in an included taskfile in another directory or when task had a custom dir. Closes #384
52 lines
983 B
YAML
52 lines
983 B
YAML
version: '3'
|
|
|
|
vars:
|
|
BUILD_DIR: $pwd
|
|
|
|
tasks:
|
|
sub/abs.txt:
|
|
desc: generates dest file based on absolute paths
|
|
deps:
|
|
- sub/src.txt
|
|
dir: sub
|
|
cmds:
|
|
- cat src.txt > '{{.BUILD_DIR}}/abs.txt'
|
|
method: timestamp
|
|
sources:
|
|
- src.txt
|
|
generates:
|
|
- "{{.BUILD_DIR}}/abs.txt"
|
|
|
|
rel.txt:
|
|
desc: generates dest file based on relative paths
|
|
deps:
|
|
- sub/src.txt
|
|
dir: sub
|
|
cmds:
|
|
- cat src.txt > '../rel.txt'
|
|
method: timestamp
|
|
sources:
|
|
- src.txt
|
|
generates:
|
|
- "../rel.txt"
|
|
|
|
sub/src.txt:
|
|
desc: generate source file
|
|
cmds:
|
|
- mkdir -p sub
|
|
- echo "hello world" > sub/src.txt
|
|
method: timestamp
|
|
status:
|
|
- test -f sub/src.txt
|
|
|
|
'my text file.txt':
|
|
desc: generate file with spaces in the name
|
|
deps: [sub/src.txt]
|
|
cmds:
|
|
- cat sub/src.txt > 'my text file.txt'
|
|
method: timestamp
|
|
sources:
|
|
- sub/src.txt
|
|
generates:
|
|
- 'my text file.txt'
|