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

Remove hardcoded dependency on a process argument. #45

Closed
wants to merge 1 commit into from

Conversation

yelgulwa
Copy link

The process argument list could be different in some case like a packaged and un-packaged Electron app. In our case, the code threw an error because this variable did not exist.

The process argument list could be different in some case like a packaged and unpackaged Electron app.
@mattallty
Copy link
Owner

Thank you for tour PR but this breaks tests as you can see.
Maybe something like this would be preferable: (to be tested)

this._bin =(process.argv && process.argv.length >= 2) ? path.basename(process.argv[1]) : '';

@yelgulwa
Copy link
Author

yelgulwa commented Apr 13, 2017

Hello @mattallty, thanks for your response. But a library should contain a good class signature and some sane defaults. The actual value to be passed should be left up to the caller. It could a value from a process argument or an environment variable etc.

@mattallty
Copy link
Owner

@yelgulwa could you please fix your PR with the given code ? Would be happy to merge it.

@mattallty mattallty closed this Oct 20, 2017
@mattallty
Copy link
Owner

Closed but will be fixed in #75

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.

None yet

2 participants