mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Only strip minor version off of interpreters
This used to turn `python2.4` into `python`, which causes trouble with `perl6`, which is a different language definition.
This commit is contained in:
@@ -2013,6 +2013,7 @@ Python:
|
|||||||
- wscript
|
- wscript
|
||||||
interpreters:
|
interpreters:
|
||||||
- python
|
- python
|
||||||
|
- python2
|
||||||
|
|
||||||
Python traceback:
|
Python traceback:
|
||||||
type: data
|
type: data
|
||||||
|
|||||||
@@ -133,10 +133,8 @@ module Linguist
|
|||||||
|
|
||||||
script = script == 'env' ? tokens[1] : script
|
script = script == 'env' ? tokens[1] : script
|
||||||
|
|
||||||
# "python2.6" -> "python"
|
# "python2.6" -> "python2"
|
||||||
if script =~ /((?:\d+\.?)+)/
|
script.sub! $1, '' if script =~ /(\.\d+)$/
|
||||||
script.sub! $1, ''
|
|
||||||
end
|
|
||||||
|
|
||||||
# Check for multiline shebang hacks that call `exec`
|
# Check for multiline shebang hacks that call `exec`
|
||||||
if script == 'sh' &&
|
if script == 'sh' &&
|
||||||
|
|||||||
Reference in New Issue
Block a user