Task

T

Task

Task is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make.

Join

Running task when dependency is not up to date

I have a task that restarts/reloads a service that depends on a number of other tasks, e.g. a build task that builds the service executable. I'd like for the task to run if any of its direct dependencies are dirty (that is, were not skipped as "up to date"), similarly how make handles dependencies. Unfortunately, the dependencies don't create convenient files to timestamp (e.g. they create a docker image) * Is there already a way to accomplish this? * I could probably have the dependencies create/touch dummy files when they run so I could compare timestamps, but this feels like the sort of trick I had to use in make šŸ˜…...

Fedora Updated Release

I’m curious what the process is for getting an updated Fedora package. We run Fedora hosts with Ubuntu containers and they run versions that are several versions off. And primarily I ask because I am interested in the fix in 3.43.2 for the handling of CLI_ARGS....

Equivalence between sources and generates

Hello! Okay, this might be a strange use case since it's not really supported by any build system that I know of. I would want to map the sources to the generates. Take the following example: ```...

Looping over files not working on Windows

Hello, I'm trying to replicate this: https://taskfile.dev/usage/#looping-over-your-tasks-sources-or-generated-files It works on Ubuntu (WSL), but I cannot make it work with Windows 10. I tried with Powershell, with Git Bash, with absolute links, with both slashes (/ and ), etc. I don't know what I could test. I do not have any error, no additional information with --verbose there is just no execution inside the for....
No description

Glob patterns in generates

Hello. According to the docs, both sources and generates can be glob patterns. ```go recipe: sources:...

Push permission

I have a feature branch that could use review, it is for go-task repository. I tried to push my branch upstream but my account doesn't have permissions

Is it possible to set an env value in a task from a variable passed in when call the task?

I would like to call a task like
task start-service use_mocks=true
task start-service use_mocks=true
And have that set a env value in my start-service task like ``` start-service:...

Possible to force execution of a specific task, but not its dependencies?

I have a task that runs a data processing pipeline, which has two dependencies for downloading data it utilizes. I'd like to use the sources / generates options, but to also be able to force a resume of this pipeline if needed. However, if I run the task with --force, that also triggers the download dependencies as well. Is there a way around this?...
Solution:
Found the answer to my question. There is currently an experimental feature for this: https://taskfile.dev/experiments/gentle-force/

Dependency hangs on rebuild

I have configured in my Taskfile a few tasks, one for building tailwind styles, one for building SQLC code, and then one that builds my Go program but has the other 2 tasks as dependencies. I want to create a parent task to run this build output binary, and rebuild it whenever any file changes, currently that has left me with this Taskfile: ```yml version: '3' ...

No direct alternative to VAR ?= VALUE from make

Hello, I just discovered that task can't leave a variable if it's already declared in the system. There's vars, which always prioritizes internal variables, and there's env, which always prioritizes external ones, and there's dotenv, which can only pull variables from a file, but not from the environment. The only option is to write if-else-end on go templates for each such variable. Is it possible to make something like ?VAR to get similar behavior? Or is there another option that I don't know...

Are variable unique across all imports ?

Hello, I notice that if 2 task have the same global variable but are imported from 2 different file, the resolution of variable is random. ```yaml...

docker --format {{ .Name }}

Hello, how to escape {{ }} from taskfile to use a variable like define using for example docker format ? vars:...

How do use double quotes in cmd on windows?

I want to run the following command:
cmds:
- cmd /c "SET VSCMD_START_DIR=%CD% && call ""%VSCOMNTOOLS%VsMSBuildCmd.bat"""
cmds:
- cmd /c "SET VSCMD_START_DIR=%CD% && call ""%VSCOMNTOOLS%VsMSBuildCmd.bat"""
...

In included file, cannot set task dir with a variable containing absolute path

I often set the dir of a task through a variable, as shown at multiple places in the docs, e.g. at: https://taskfile.dev/usage/#looping-over-your-tasks-sources. However, for included files, this works not correctly if the path is absolute. For included files, it seems to be impossible to set the dir to an absolute path using a variable. root file: Taskfile.yaml...
No description

dotenv merges in inverse order?

Hi, when specifying two dotenv files that contain common keys, it seems that priority is given to the first file instead of the last file. This seems counter-intuitive to me and is the opposite of what was found in https://discord.com/channels/974121106208354339/1064231491883782215/1064231491883782215. first.env: ``` A=a...
Solution:
IIRC there was some discussion at the time on the priority order. We made a deliberate decision to implement this way. The idea is to follow the behavior of how .env files usually work. They do not override values that are already set on the ENV. In the same way, we loop over the list of .env files and only set the ENVs that were not previously set....

Task is not tracking deleted generated files

Hello, I think I found the case to reopen this issue: https://github.com/go-task/task/issues/238 I want the Task to re-trigger gen, when I'm running clean: ...

Task: <name> is up to date even if run: when_changed.

Hello. Do I understand correctly that the message above is not an error and will always be displayed even if task is not needed? Or did I set something up wrong and it shouldn't be there? If it always shows up, can I hide it? That is, I would like to not deduplicate unnecessary tasks within one run, but not show this message at all if the task does not start for this reason. In other words, this message is not needed, because I can already see that task: [name] was not called from the output....
No description

Task and tracking dir modtime

Hello. Let's say I'm changing tools/cmd/main.go and want to make a task that will track it by pattern. I know that this pattern will track any file in dir recursively. ```yaml check:...
Solution:
Hi @sedyh, This happens because Task actually ignores directories and only cares about files....

Run command for each source found by pattern without find.

Hello, is there a coreutils-free alternative for something like: ```yaml gen: sources: [internal/*_src.go]...
Next