facebook / jscodeshift

A JavaScript codemod toolkit.
https://jscodeshift.com
MIT License
9.11k stars 468 forks source link

feat(crlf): add ending space to avoid env: node\r: No such file or di… #549

Closed sibelius closed 1 year ago

sibelius commented 1 year ago

…rectory, fix #424

Daniel15 commented 1 year ago

I'm worried that someone saving the file with an editor that automatically strips out trailing spaces will remove the spaces, but for now I think this is OK! Thanks.

jakeboone02 commented 1 year ago

Hello, I just found this issue when trying to get jscodeshift to run with Bun. See oven-sh/bun#2516.

While I think Bun should ultimately work around the issue, the solution in this PR does not actually resolve it in Bun's case (see https://github.com/oven-sh/bun/issues/2516#issuecomment-1493140136), it just leads to other issues.

Is there any way jscodeshift could just ship LF line endings for /bin/jscodeshift.js? I think a .gitattributes file like this would work:

bin/jscodeshift.js eol=lf

I'd be happy to submit a PR to that effect. Update: #555.