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

Fix #306, and bin-file in $PATH make sense #327

Merged
merged 1 commit into from
Jan 17, 2015
Merged

Conversation

zhiyelee
Copy link
Collaborator

Almost revert #173 which lead to the bug in #306

Also remove deprecated customFds option in spawn

solve tj#306, and bin in $PATH make sense now tj#196
Almost revert tj#173 which lead to the bug in tj#306

Also remove deprecated customFds option in spawn
@zhiyelee
Copy link
Collaborator Author

@DigitalIO This PR is incompatible with #305 .

Indeed we can put the --harmony in the shebang

file: ~/bin/pm-list

#!/usr/bin/env node --harmony
"use strict";

let a = 5
console.log(5)

which works well with current PR:

✍ examples/pm list
5

How do u think about this? @DigitalIO @SomeKittens @thethomaseffect

@DigitalIO
Copy link

Adding --harmony to the shebang doesn't work in all environments, unfortunately. Some discussion. I've tried the example script on Debian (Stable) and Windows ("Git Bash") and it fails on both for me.

I have been initiating the scripts with node directly

> node --harmony examples/pm list

Not the best solution, but the best compromise I have found thus far.

@zhiyelee
Copy link
Collaborator Author

@DigitalIO windows will use this branch: https://github.com/tj/commander.js/pull/327/files#diff-168726dbe96b3ce427e7fedce31bb0bcR481
Your patch can be applied here.

Do u mean Debian don't support the --harmony option in the shebang?

#!/usr/bin/env node --harmony
"use strict";

let a = 5
console.log(5)

@DigitalIO
Copy link

Correct. env attempt to match "node --harmony" as a function, instead of "node" with the "--harmony" flag. It results in this error:

/usr/bin/env: node --harmony: No such file or directory

@zhiyelee
Copy link
Collaborator Author

@DigitalIO Seems there is a bug in Debian on the /usr/bin/env: node. nodejs/node-v0.x-archive#3911

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