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:
Brandon Keepers
2014-11-20 12:28:30 -05:00
parent 870feb8592
commit 56bfde998b
2 changed files with 3 additions and 4 deletions

View File

@@ -133,10 +133,8 @@ module Linguist
script = script == 'env' ? tokens[1] : script
# "python2.6" -> "python"
if script =~ /((?:\d+\.?)+)/
script.sub! $1, ''
end
# "python2.6" -> "python2"
script.sub! $1, '' if script =~ /(\.\d+)$/
# Check for multiline shebang hacks that call `exec`
if script == 'sh' &&