-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the recommended way to wait for a running task? #90
Comments
Hi, I've just needed this too. It is not ideal and it works best with verbose renderer (for default renderer, I output to a file). This is good enough for me.
^ outputStream is either process.stdout or WriteStream |
Hi. Yes you can use Observables for this as the documentation states. You can re-use a utility function that we use at This does answer your question :)? |
@SamVerschueren Yes that is a step in the right direction and much more clear! This is my first time working with ✖ Releasing via np...
(node:12700) UnhandledPromiseRejectionWarning: Error: Command failed: np prepatch --tag=next --any-branch --no-cleanup Followed by the trace (in this case, unclean working branch). ✖ Unclean working tree. Commit or stash changes first.
[11:08:14] Prerequisite check [started]
[11:08:14] Ping npm registry [started]
[11:08:14] Ping npm registry [skipped]
[11:08:14] Verify user is authenticated [started]
[11:08:14] Verify user is authenticated [skipped]
[11:08:14] Check git remote [started]
[11:08:14] Check git remote [completed]
[11:08:14] Validate version [started]
[11:08:14] Validate version [completed]
[11:08:14] Check for pre-release version [started]
[11:08:14] Check for pre-release version [completed]
[11:08:14] Check npm version [started]
[11:08:14] Check npm version [completed]
[11:08:14] Check git tag existence [started]
[11:08:15] Check git tag existence [completed]
[11:08:15] Prerequisite check [completed]
[11:08:15] Git [started]
[11:08:15] Check local working tree [started]
[11:08:15] Check local working tree [failed]
[11:08:15] → Unclean working tree. Commit or stash changes first.
[11:08:15] Git [failed]
[11:08:15] → Unclean working tree. Commit or stash changes first. I get this regardless of if I |
@SamVerschueren I've setup a repo with an example of what I mean by "unhandled promise error". https://github.com/Aghassi/promise-observables If you run |
This is the issue I'm having, the task is showing as completed straight away even though it's still being processed. Tried using the Edit: Ignore my comment, figured it out using promises, example... return new Promise((resolve, reject) => {
try {
execa('composer', ['install', '-d=public_html']).then(() => resolve());
} catch(error) {
reject(new Error(error));
}
}); |
Hello there 😄
I have a question after having read through the docs multiple times. Say I'd like to execute a function like https://github.com/sindresorhus/np or
yarn
via atask
. There are many examples in the README of how to execute, but what I am unclear on is how to have it so it shows the progress while this task runs. The reason I ask is because say I do something likeexeca('np patch')
as the command for atask
. The task will go through and "succeed" because the function executed correcly. However, the output/failure of said function is not displayed anywhere.However, if I do
execa.syncShell('np patch')
as thetask
, Listr will proceed by running the task and not showing any progress until the task is complete. This is good because it doesn't progress until the step is done. This is bad because it doesn't render any progress while the task runs.Granted, I may have a basic misunderstanding of how this tool works, so I am just looking for some clarity on the best way to wrap or use other javascript utilities. I assume I may be able to use
Observable
here, but the documentation isn't very clear on the best way to go about doing that.So, I guess to sum up: What is the appropriate way to forward/watch a currently running task while also generating output while it runs?
The text was updated successfully, but these errors were encountered: