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

Shebang with Windows EOL #31

Open
PioMie opened this issue Sep 7, 2020 · 0 comments
Open

Shebang with Windows EOL #31

PioMie opened this issue Sep 7, 2020 · 0 comments

Comments

@PioMie
Copy link

PioMie commented Sep 7, 2020

We have a file with shebang header (because of Mac users).
We have core.autocrlf=true therefore the line endings on Macs are \n and Win \r\n.

When checking headers on Windows it never finds headers. It has to detect them in a file starting with:
#!/usr/bin/env node\r\n/**\r\n * Copyright\r\n */

There is a little mistake in hasHeader method:
var m = src.match(/(\r\n|\r|\n)/); does not fit to the:
src = src.slice(m.index + 1); - in case of Windows' EOL the are two characters instead of one.

I have a fix proposition in this pull request

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

No branches or pull requests

1 participant