Rerun task on dep build.
Is there a way to make a task run when one of it's deps was rebuilt in the current run
2 Replies
Hi @noel,
Perhaps you could paste a small example Taskfile on what exactly you're trying to do?
What is preventing that task to run? Is it fingerprinting (via
sources:
) or are you using run: :once
?It is fingerprinting via sources.
And im using run:once.
Btw how can i use variables inside generates or sources.
Does this look right ? Is there a way to debug why a task did or didnt run ?
Here is a sample taskfile.
What i wanted: to run
task all
and it to only run cmds for worker if either its sources change or if deps were rebuilt.
But now after i added var. If i run task my-client
it reruns everytime, even if generates file has newer timestamp. It works as intended if i hardcode the values instead of using variables.
update: when i got rid of method: timestamp, task my-client
seems to skip when there are no changes in the src as expected. But build-worker doesn't seem to rebuild even when my-client
builds
update: i realize that i since im now using hash instead of timestamp and I my test changes didnt changes the content of this specific output file. So i updated the CLIENT_TARGET to /Users/foo/client/dist/**/*.js
. But still doesnt seem to work as expected.
Do you reckon it would be nice to have something like make --debug
which tell you exactly why a target had to be rebuilt.
btw. fyi. I was only testing out Taskfile because it seemed so much cleaner than make.
I love the docs, and api. and how much cleaner it is.
Would really love a --debug
option though.