Unverified Commit fe72addb authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

Fix watchmode for `taskr` tasks (#80020)

parent aefa6f15
...@@ -2835,11 +2835,21 @@ export async function build(task, opts) { ...@@ -2835,11 +2835,21 @@ export async function build(task, opts) {
} }
export async function generate_types(task, opts) { export async function generate_types(task, opts) {
await execa( const watchmode = opts.dev
const typesPromise = execa(
'pnpm', 'pnpm',
['run', 'types', ...(opts.dev ? ['--watch', '--preserveWatchOutput'] : [])], [
'run',
'types',
...(watchmode ? ['--watch', '--preserveWatchOutput'] : []),
],
{ stdio: 'inherit' } { stdio: 'inherit' }
) )
// In watch-mode the process never completes i.e. the Promise never resolve.
// But taskr needs to know that it can start watching the files for the task it has to manually restart.
if (!watchmode) {
await typesPromise
}
} }
export async function check_error_codes(task, opts) { export async function check_error_codes(task, opts) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment