Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Perl hashbang doesn't trigger autodetection correctly for files called install. #85

Open
1 task done
mscharley opened this issue Mar 16, 2017 · 2 comments
Open
1 task done
Labels

Comments

@mscharley
Copy link

Prerequisites

Description

The #!/usr/bin/env perl hashbang doesn't trigger Perl as the autodetected language. In my setup it defaults to PHP instead.

Steps to Reproduce

  1. Create a new file called install.

  2. Add the following code to the file:

     #!/usr/bin/env perl
     use strict;
    
  3. Set the file type to "Autodetect".

Expected behavior: The autodetected language is Perl.

Actual behavior: The autodetected language is PHP.

Reproduces how often:

100% reproduction with the filename install. Seems to be tied to this specific filename and I'm not sure why - I tried install.pl and foo and both got autodetected correctly as Perl files.

Versions

Atom    : 1.15.0
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0
@winstliu
Copy link
Contributor

@mscharley
Copy link
Author

Damn, a file called simply install is still registered as being a file of type install. That's an unfortunate conflict, but I imagine it's probably necessary to handle things like Rakefile and similar that are just bare names.

For context, https://github.com/mscharley/dotfiles/blob/master/install.pl which I've simply renamed for now. Maybe this should be an issue against atom/language-php then because I do know that some PHP frameworks use *.install frequently. Still seems like a bad idea to take over all files called install though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants