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
We have a file with shebang header (because of Mac users).
We have core.autocrlf=true therefore the line endings on Macs are
\nand 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
hasHeadermethod: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