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

Unix/Linux line endings in CLI need to be enforced #2800

Closed
ScottFreeCode opened this issue May 14, 2017 · 2 comments
Closed

Unix/Linux line endings in CLI need to be enforced #2800

ScottFreeCode opened this issue May 14, 2017 · 2 comments
Labels
area: windows Windows-specific status: needs upstream fix defect within Mocha's dependency tree type: chore generally involving deps, tooling, configuration, etc.

Comments

@ScottFreeCode
Copy link
Contributor

bin/mocha and bin/_mocha need to have Unix line endings. Currently Git's autocrlf setting can screw this up. (See also #2799 for an example of when this goes wrong.) Our tests don't check for it either.

We will need to either check for or fix the line endings in these files as part of publishing. Or, if doing it on publish isn't feasible (prepublish vs. prepublishOnly seems to be a bit of an issue?), on version (most of our other publishing prep is in versioning already anyway...).

Ideally, I'd like to just run a Node command and convert the line endings, so it doesn't matter what Git did (or the user, etc) -- this isn't something that should have to be fixed manually when it is detected.

@ScottFreeCode ScottFreeCode added type: chore generally involving deps, tooling, configuration, etc. high-priority status: accepting prs Mocha can use your help with this one! area: windows Windows-specific labels May 14, 2017
@ScottFreeCode ScottFreeCode added status: needs upstream fix defect within Mocha's dependency tree and removed high-priority status: accepting prs Mocha can use your help with this one! labels May 14, 2017
@ScottFreeCode
Copy link
Contributor Author

Actually, since this affects potentially any cross-platform CLI package, we ought to submit a fix to npm/npm#13203 I am thinking maybe do "\r\n"->"\n" conversion on the files that are being linked in node_modules/.bin at install time?

@ScottFreeCode
Copy link
Contributor Author

npm/npm#12371 actually has a very similar suggestion as its main post (I guess 13203 is more of a duplicate)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: windows Windows-specific status: needs upstream fix defect within Mocha's dependency tree type: chore generally involving deps, tooling, configuration, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant