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
Not sure if necessary, but there are cases when we want to run a particular trigger only once.
Consider how to combine watch mode with manual task execution: There are steps in our setup that need to run once, but then may need to be re-run during the lifetime of the watch mode, e.g. We have a script to download assets from Figma. It makes no sense to re-run this logic based on local file changes, but need to provide a way for users to re-run this script when they need to. In our case, we run it once when initiating Turbowatch and then anyone can run it manually by using turbo generate, which will be picked up by Turbowarch. For Turborepo, this probably means that watch scripts just utilize dependsOn to run some tasks once before going into the watch mode.
As far as I can think, this is true only for commands that need to once at the start. We are currently handling this with:
{expression: ['match','*'],interruptible: false,name: 'generate',onChange: async({ spawn, first })=>{if(first){awaitspawn`pnpm turbo run generate`;}},},
This works, but it will keep logging generate every time it detects relevant changes. A more elegant solution would allow trigger to deregister or simply indicate that trigger only has to run once at the start.
The text was updated successfully, but these errors were encountered:
Not sure if necessary, but there are cases when we want to run a particular trigger only once.
As far as I can think, this is true only for commands that need to once at the start. We are currently handling this with:
This works, but it will keep logging
generate
every time it detects relevant changes. A more elegant solution would allow trigger to deregister or simply indicate that trigger only has to run once at the start.The text was updated successfully, but these errors were encountered: