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

support shebangs not starting with whitespace #7

Open
jesperronn opened this issue Oct 1, 2020 · 2 comments
Open

support shebangs not starting with whitespace #7

jesperronn opened this issue Oct 1, 2020 · 2 comments

Comments

@jesperronn
Copy link

jesperronn commented Oct 1, 2020

From the examples and tests I see that only examples where a space is after the shebang works.

#! /usr/bin/env python ==> works
#!/usr/bin/env python ==> broken

The latter did not work for me. I have a file with #!/usr/bin/env ruby

I briefly looked that the code, but fail to find the specific place in the detection regext/splitting that could fix it.

Can you do it?

Background read: https://unix.stackexchange.com/questions/276751/is-space-allowed-between-and-bin-bash-in-shebang

@julien-lang
Copy link
Owner

Hi Jesper,

Thanks for the report. I am a bit suprised about that because I though I already covered this case.

Also, when I check the code, in the read_shebang function, I first check if the line starts with #!, then I take the rest of the line and strip. So whether or not there is a space after the #! should work.

I'll try to test that soon but since I don't really use Atom anymore, I don't know when this will be.

Don't hesitate to provide a code change if you figure it out.

@julien-lang
Copy link
Owner

I just check those 2 cases you provided and I am not able to reproduce the issue. It works in both cases for me.

Something even more suprising is that it keeps working when I disable my plugin. So I wonder if this plugin is still useful for Atom or if Atom now embeds this feature as "core".

What version of Atom are you testing on?

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