SamVerschueren / vscode-yo

Yeoman plugin for VS Code
MIT License
87 stars 15 forks source link

Extension calls process.exit() #23

Closed bpasero closed 8 years ago

bpasero commented 8 years ago

I noticed that your extension (probably Yo itself) is calling process.exit() at some point. I know some node JS libraries tent to abuse process.exit() as a way to do flow control in their program. I see this happening when I abort Yo after it found a conflict when applying file changes.

In the future VS Code will ignore process.exit() calls because otherwise the extension host goes down and you would have to restart VS Code.

I wonder how Atom behaves here I am sure they have the same problem, do you happen to know?

Not sure you can do anything about it but if Yo claims to be pluggable, they must also provide a way to avoid process.exit(). In fact, they should not even use it at all.

SamVerschueren commented 8 years ago

Any thoughts @sindresorhus @SBoudrias?

SBoudrias commented 8 years ago

The only place yeoman is calling process.exit() is effectively when the user select the abort option during a conflict. We should probably change this, feel free to open an issue on the yeoman/generator repo to discuss alternative further.

bpasero commented 8 years ago

I wonder if this causes Atom to just exit ;)

SamVerschueren commented 8 years ago

I don't think the diffing is implemented by atom-yeoman

// @david-driscoll

SamVerschueren commented 8 years ago

@bpasero Are you creating a new issue in yeoman/generator or should I do it?

bpasero commented 8 years ago

@SamVerschueren please go ahead and file it, thanks!

SamVerschueren commented 8 years ago

This was fixed and released in 0.22.1 of the yeoman-generator. Generators that are not updated to this release will still call process.exit() instead of throwing an AbortedError.