Task Directory
Refer here for Include other Taskfile to run on different directory
We know that tasks are run in the current directory where the Taskfile is located. However, you can actually run the Taskfile tasks in another directory by using the dir keyword.
Taskfile.yml
version: '3'
tasks:
get-working-directory:
dir: ./app1
cmds:
- pwdIf the directory does not exist, Task will create it.
Demo and output
ubuntu@touted-mite:~$ task get-working-directory
task: [get-working-directory] pwd
/home/ubuntu/app1Last updated on