noel
noel
TTask
Created by noel on 11/14/2024 in #help
Rerun task on dep build.
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.
8 replies
TTask
Created by noel on 11/14/2024 in #help
Rerun task on dep build.
Do you reckon it would be nice to have something like make --debug which tell you exactly why a target had to be rebuilt.
8 replies
TTask
Created by noel on 11/14/2024 in #help
Rerun task on dep build.
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.
8 replies
TTask
Created by noel on 11/14/2024 in #help
Rerun task on dep build.
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
8 replies
TTask
Created by noel on 11/14/2024 in #help
Rerun task on dep build.
Here is a sample taskfile.
version: '3'

silent: true
run: once
method: timestamp

vars:
CLIENT_TARGET: /Users/foo/client/dist/api.js


tasks:
my-client:
desc: "Building client"
dir: /Users/foo/client
sources: ["**/*.ts"]
generates: [ {{.CLIENT_TARGET}} ]
cmds:
- echo "🚀 Building client"
- chronic npm run build

build-worker:
desc: "Building worker"
deps: [my-client]
dir: /Users/foo/worker
sources: ["**/*.js", "{{.CLIENT_TARGET}}" ]
cmds:
- echo "🚀 Building worker"
- chronic pm2 restart worker


all:
desc: "Built all"
deps: [ build-worker, my-client]
version: '3'

silent: true
run: once
method: timestamp

vars:
CLIENT_TARGET: /Users/foo/client/dist/api.js


tasks:
my-client:
desc: "Building client"
dir: /Users/foo/client
sources: ["**/*.ts"]
generates: [ {{.CLIENT_TARGET}} ]
cmds:
- echo "🚀 Building client"
- chronic npm run build

build-worker:
desc: "Building worker"
deps: [my-client]
dir: /Users/foo/worker
sources: ["**/*.js", "{{.CLIENT_TARGET}}" ]
cmds:
- echo "🚀 Building worker"
- chronic pm2 restart worker


all:
desc: "Built all"
deps: [ build-worker, my-client]
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.
8 replies
TTask
Created by noel on 11/14/2024 in #help
Rerun task on dep build.
It is fingerprinting via sources. And im using run:once. Btw how can i use variables inside generates or sources.
generates: [ "{{.MY_VAR}}" ]
generates: [ "{{.MY_VAR}}" ]
Does this look right ? Is there a way to debug why a task did or didnt run ?
8 replies