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

Windows EOLs break shebang #1

Closed
raphinesse opened this issue May 14, 2017 · 5 comments
Closed

Windows EOLs break shebang #1

raphinesse opened this issue May 14, 2017 · 5 comments

Comments

@raphinesse
Copy link

raphinesse commented May 14, 2017

The tool does not work under Linux, because of the Windows-EOL characters:

$ node_modules/.bin/sync-version bower.json
/usr/bin/env: ‘node\r’: No such file or directory

As a general suggestion based on my own experience: only use Unix EOLs (LF) for code, ever.

I cannot file a PR with a fix, since the problem seems to be how the package is published on npm.
When I clone the repo on my Linux system, I get Unix EOLs.

@eight04
Copy link
Owner

eight04 commented May 15, 2017

Interesting... I thought git should handle this automatically.

Now I wonder if this affect all my repos 😨

@eight04
Copy link
Owner

eight04 commented May 15, 2017

I got it. This is caused by npm not git.
npm/npm#12371

Maybe it's time to use some CI services.

@raphinesse
Copy link
Author

If the CI would have cloned the repo using git, it wouldn't have caught this either. That's a sneaky bug, for sure.

But as long as you just work with LF everything should be fine. The prepublish hook in the script seems like a good idea. I just have my editor configured to always produce LF. Alternatively, you could configure it per project, using editorconfig. And then you can of course also make ESLint yell at you if you manage to sneak in some CRLF anyway 😉

eight04 added a commit that referenced this issue May 15, 2017
@eight04
Copy link
Owner

eight04 commented May 15, 2017

Try v1.0.1

@raphinesse
Copy link
Author

Works like a charm! Thanks for the quick resolution.

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

2 participants