-
Notifications
You must be signed in to change notification settings - Fork 75
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
Log stdout and stderr from plugin installation and removal #1682
Log stdout and stderr from plugin installation and removal #1682
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @emlys ! The async chaining approach makes sense to me and reads okay too. I had one documentation question.
I'm also curious, now that this is asynchronous, is the user able to close out of the plugin modal while the process is running? I feel like a common thing might be for a user to want to continue working on other things while the plugin loads and get back to the main Workbench window. Nothing needed to address in this PR, just thinking ahead.
@@ -11,59 +11,98 @@ import { settingsStore } from './settingsStore'; | |||
|
|||
const logger = getLogger(__filename.split('/').slice(-1)[0]); | |||
|
|||
function spawnWithLogging(cmd, args, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this function have a docstring above it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a docstring
@dcdenu4 it is possible to close the plugin modal and the plugin install keeps running in the background. There are probably some possible UX improvements to that situation but it does seem to work |
await spawnWithLogging( | ||
'git', | ||
['clone', '--depth', '1', '--no-checkout', pluginURL, tmpPluginDir] | ||
).then(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emlys , forgive me for popping in here. I don't think we need the .then
chaining now that we're using await
and resolving the promise when the spawn process closes. I think you should just be able to do like this,
await spawnWithLoggin('git clone ...');
await spawnWithLogging('git checkout ...');
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @emlys, I'll add my approval since I'll be offline for most of today. But note @davemfish comment!
…nvest into plugin-install-log-stdio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Description
Fixes #1673
Fixes #1665
Stdout and stderr from subprocesses involved in plugin install/uninstall are now logged. They continue to show up in the terminal in dev mode, and now also appear in the workbench log in dev and production mode. Plugin installation errors are no longer displayed in the UI, but a message is shown pointing to the workbench log.
Checklist