lib/linguist/shebang.rb in github-linguist-7.15.0 vs lib/linguist/shebang.rb in github-linguist-7.16.0
- old
+ new
@@ -39,10 +39,13 @@
script = path.split('/').last
# if /usr/bin/env type shebang then walk the string
if script == 'env'
s.scan(/\s+/)
- s.scan(/([^\s]+=[^\s]+\s+)*/) # skip over variable arguments e.g. foo=bar
+ while s.scan(/((-[i0uCSv]*|--\S+)\s+)+/) || # skip over optional arguments e.g. -vS
+ s.scan(/(\S+=\S+\s+)+/) # skip over variable arguments e.g. foo=bar
+ # do nothing
+ end
script = s.scan(/\S+/)
end
# Interpreter was /usr/bin/env with no arguments
return unless script