1
0
mirror of https://github.com/go-task/task.git synced 2025-11-06 09:09:13 +02:00

Allow absolute path in generates section

Fixes issue #47 by allowing absolute paths in a task's generates and
sources sections. Tests are added for the generates section only at this
time.
This commit is contained in:
Sindre Røkenes Myren
2017-07-12 11:30:28 +02:00
committed by Sindre Røkenes Myren
parent a586fef414
commit 86a23849e0
5 changed files with 98 additions and 2 deletions

1
testdata/generates/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.txt

34
testdata/generates/Taskfile.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
abs.txt:
desc: generates dest file based on absolute paths
deps:
- sub/src.txt
dir: sub
cmds:
- cat src.txt > '{{.BUILD_DIR}}/abs.txt'
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'
sources:
- src.txt
generates:
- "../rel.txt"
sub/src.txt:
desc: generate source file
cmds:
- mkdir -p sub
- echo "hello world" > sub/src.txt
# Sleep to avoid time-stamp issue. Some filesystems, E.g. HFS+ for Mac OS,
# only support one second precision on file timestamps.
- sleep 1
status:
- test -f sub/src.txt

1
testdata/generates/Taskvars.yml vendored Normal file
View File

@@ -0,0 +1 @@
BUILD_DIR: $pwd