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

Set process.argv[1] to the name of the script being run #1092

Closed
wants to merge 1 commit into from
Closed

Set process.argv[1] to the name of the script being run #1092

wants to merge 1 commit into from

Conversation

TrevorBurnham
Copy link
Collaborator

This is a fix for issue 1087.

Quite simply, process.argv[1] should equal __filename (the name of the script being run); but currently, only __filename is being set. So if you run coffee foo.coffee, then __filename is foo.coffee but process.argv[1] is the location of coffee. With this patch, process.argv[1] should always equal __filename.

This makes the behavior of

coffee foo.coffee

more consistent with that of

coffee -c foo.coffee
node foo.js

@jashkenas
Copy link
Owner

Thanks, Trevor, merged to master. For future bugfixes like this one, it would be great if you could add them to the "stable" branch instead of to a branch off "master" -- then, I can merge instead of cherry-picking.

@michaelficarra
Copy link
Collaborator

Closed, since this was apparently already merged.

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

Successfully merging this pull request may close these issues.

3 participants