Skip to content

gracefully handle process.stdin exceptions #2837

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

Merged
merged 1 commit into from
Mar 5, 2017

Conversation

scottaddie
Copy link
Contributor

Summary
Several users of Visual Studio 2015 & 2017's NPM Task Runner extension have reported problems on Windows 7 with regard to running Yarn commands inside the IDE's Task Runner Explorer window. Interestingly enough, this doesn't appear to be an issue on Windows 10.

A fix for this problem was attempted here. The Angular CLI project also encountered the same problem, and it was fixed here.

This PR takes a very similar approach as that taken by the Angular CLI team. The PR also doesn't specifically test for the "win32" platform, as who knows what other platforms are really impacted by this.

Test plan
I ran the following commands to ensure that my changes didn't introduce any problems:
yarn run build
yarn run lint
yarn run test

try {
standardInput = process.stdin;
} catch (e) {
delete process.stdin;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this should console.warn(e.message)?

@Daniel15
Copy link
Member

Daniel15 commented Mar 5, 2017

Looks good to me, thanks! If this fix is okay for Angular-cli, it's probably fine for Yarn too 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants