Rots
Rots
TTask
Created by Rots on 11/28/2024 in #help
Convert string variable to integer
I'd like to convert my string variable to an integer, how can I do it? Are the some conversion functions supported by the templating language?
3 replies
TTask
Created by Rots on 12/7/2022 in #help
Escaping templating - colon space is special in yaml
# https://taskfile.dev

version: '3'

tasks:
demo-ok: echo '{{`a:b`}}'
demo-fail: echo '{{`a: b`}}'
demo-alt-ok: "echo '{{`a: b`}}'"
# https://taskfile.dev

version: '3'

tasks:
demo-ok: echo '{{`a:b`}}'
demo-fail: echo '{{`a: b`}}'
demo-alt-ok: "echo '{{`a: b`}}'"
Notice the space difference between first and second case causes a failure. The failure seems to happen at parse time, how come yaml parser is confused?
2 replies
TTask
Created by Rots on 10/27/2022 in #help
Dependencies not being run
I think I've found a bug....
version: '3'

tasks:
hello:
cmd: echo 'Hello World from Task!'
deps:
- there
hello2:
cmds: [echo 'Hello World from Task!']
deps:
- there
there: echo "there" && sleep 5 && echo "done"
version: '3'

tasks:
hello:
cmd: echo 'Hello World from Task!'
deps:
- there
hello2:
cmds: [echo 'Hello World from Task!']
deps:
- there
there: echo "there" && sleep 5 && echo "done"
If I now run:
$ task hello
task: [hello] echo 'Hello World from Task!'
Hello World from Task!
$ task hello2
task: [there] echo "there" && sleep 5 && echo "done"
there
done
task: [hello2] echo 'Hello World from Task!'
Hello World from Task!
$ task hello
task: [hello] echo 'Hello World from Task!'
Hello World from Task!
$ task hello2
task: [there] echo "there" && sleep 5 && echo "done"
there
done
task: [hello2] echo 'Hello World from Task!'
Hello World from Task!
the hello task doesn't run the dependencies, hello2 is fine Is this expected or am I doing something wrong?
8 replies