Skip to content

Shebang with Windows EOL #31

@PioMie

Description

@PioMie

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions