Skip to content
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

fallback to package.json when stdin closed with no content #325

Merged
merged 2 commits into from Feb 17, 2017
Merged

fallback to package.json when stdin closed with no content #325

merged 2 commits into from Feb 17, 2017

Conversation

ghost
Copy link

@ghost ghost commented Feb 15, 2017

I'm making this change to with #119

The change is to support a parent process starting ncu with child_process, closing stdin without piping package.json content and having ncu fallback to search for package.json from fs.

Copy link
Owner

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

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

Thanks!

Good job navigating that programRunLocal logic! 😆

test/test-ncu.js Outdated
it('should fall back to package.json search when receiving empty content on stdin', function (done) {
var childProcess = child.exec('node bin/ncu', function (error, stdout) {
if (error) {
throw new Error(error);
Copy link
Owner

Choose a reason for hiding this comment

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

Throwing an error in a callback will not necessarily bubble up. You should call done(error) instead to explicitly fail the test.

programError(chalk.red(relPathToPackage + ' not found'));
}
return pkgData.then(function (_pkgData) {
print('wtf', _pkgData);
Copy link
Owner

Choose a reason for hiding this comment

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

Remove

@ghost
Copy link
Author

ghost commented Feb 16, 2017

Whoops! That def shouldn't have made it through :)

@ghost ghost closed this Feb 17, 2017
@ghost ghost reopened this Feb 17, 2017
@raineorshine
Copy link
Owner

Thanks, looks good!

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.

1 participant