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
I want to output a message AFTER all the tasks have run, but it seems Tasuku somehow always hijacks the order of messages. I tried to use .then() and await the task itself, but no success...
How can I ensure my message is displayed AFTER the task messages?
Reproduction
importtaskfrom'tasuku';constdelay=(ms)=>{returnnewPromise(function(resolve){setTimeout(resolve,ms);});}constresponse=awaittask(`My task`,()=>(delay(100))).then(()=>{console.log('THEN command');});console.log('should print after response, no?');
Output
Environment
tasuku version: 1.0.2
Operating System: OSX Monterey 12.2.1
Node version: v14.18.2
Package manager (npm/yarn/pnpm) and version:
The text was updated successfully, but these errors were encountered:
@vitormv Did you manage to solve this somehow? I’m like 80% into migrating a big CLI from Listr to tasuku and am only now noticing that I’m having this issue. 😨 Really need to be able to give some final feedback once the last tasuku task has finished.
I guess there's a workaround — you need to wrap console.logs and use taskApi.setOutput for display. Not sure if putting anything in console in unmanaged fashion is supported by ink (tasuku is running on)
As a workaround for logging you may use stderr (console.error) as output and redirect stderr via 2>/dev/ttysX where /dev/ttysX is just the example of tty command run in another terminal) but that's troublesome.
Bug description
I want to output a message AFTER all the tasks have run, but it seems Tasuku somehow always hijacks the order of messages. I tried to use
.then()
and await the task itself, but no success...How can I ensure my message is displayed AFTER the task messages?
Reproduction
Output
Environment
The text was updated successfully, but these errors were encountered: