mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-29 21:31:01 +00:00
Allow blob data to be nil
This commit is contained in:
@@ -84,7 +84,7 @@ module Linguist
|
|||||||
def shebang_script
|
def shebang_script
|
||||||
return if !text? || large?
|
return if !text? || large?
|
||||||
|
|
||||||
if (match = data.match(/(.+)\n?/)) && (bang = match[0]) =~ /^#!/
|
if data && (match = data.match(/(.+)\n?/)) && (bang = match[0]) =~ /^#!/
|
||||||
bang.sub!(/^#! /, '#!')
|
bang.sub!(/^#! /, '#!')
|
||||||
tokens = bang.split(' ')
|
tokens = bang.split(' ')
|
||||||
pieces = tokens.first.split('/')
|
pieces = tokens.first.split('/')
|
||||||
|
|||||||
Reference in New Issue
Block a user