You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm using Task version 3.0.0 on Windows and I'm very happy about this build tool.
While using this program, I noticed one feature would be very helpful: Trigger a rebuild based on the change of a variable.
In my case, it's the PURGE variable which if activated, generates a smaller file.
If I run at first task build assets and then task build assets PURGE=true, no rebuild is triggered. But in this case it would be very useful, because the output file would change. Of course you can use the --force option to always trigger a rebuild.
I tried to implement my own workaround. But this does only work on Unix shells (/bin/bash, Git Bash ...) and not if you're using the PowerShell.
Here you can take a look at my Taskfile.yml
version: '3'tasks:
assets:
desc: Creates the assets using yarndir: resourcescmds:
- yarn
- yarn run build
- echo "{{if .PURGE}}true{{else}}false{{end}}" > last_build_mode # my workaroundsources:
- styles.cssgenerates:
- output.cssstatus:
- cat last_build_mode
- test "{{if .PURGE}}true{{else}}false{{end}}" = $(cat last_build_mode) # my workaroundenv:
NODE_ENV:
sh: echo {{if .PURGE}} production {{else}} development {{end}}
My suggestion would be to add a new field like var-deps, where you can specify variables which trigger a rebuild.
version: '3'tasks:
assets:
desc: Creates the assets using yarndir: resourcescmds:
- yarn
- yarn run buildsources:
- styles.cssgenerates:
- output.cssvar-deps:
- PURGE
Thanks a lot for this useful software. :)
The text was updated successfully, but these errors were encountered:
tl;dr: it creates a config file under .task/config/<target> based on a variable name pattern. Any change does trigger a rebuild.
However the script .task_config.sh is written specifically for the project, but you could adapt it to generate a sub-config based on your own variable name pattern.
IMHO this could be a great new task feature 👍 If there is interest, i would give it a try.
Hello,
I'm using Task version 3.0.0 on Windows and I'm very happy about this build tool.
While using this program, I noticed one feature would be very helpful: Trigger a rebuild based on the change of a variable.
In my case, it's the
PURGE
variable which if activated, generates a smaller file.If I run at first
task build assets
and thentask build assets PURGE=true
, no rebuild is triggered. But in this case it would be very useful, because the output file would change. Of course you can use the--force
option to always trigger a rebuild.I tried to implement my own workaround. But this does only work on Unix shells (/bin/bash, Git Bash ...) and not if you're using the PowerShell.
Here you can take a look at my
Taskfile.yml
My suggestion would be to add a new field like
var-deps
, where you can specify variables which trigger a rebuild.Thanks a lot for this useful software. :)
The text was updated successfully, but these errors were encountered: