Skip to content

Commit

Permalink
gem: make sure only the shebang on the very first line of the script …
Browse files Browse the repository at this point in the history
…gets replaced
  • Loading branch information
ZeroPointEnergy committed Jul 22, 2016
1 parent 8add9bc commit be71a16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fpm/package/gem.rb
Expand Up @@ -209,7 +209,7 @@ def install_to_staging(gem_path)
next unless File.ftype(file_path) == 'file'
# replace shebang in files if there is one
file = File.read(file_path)
if file.gsub!(/^#!.*$/, "#!#{attributes[:gem_shebang]}")
if file.gsub!(/\A#!.*$/, "#!#{attributes[:gem_shebang]}")
File.open(file_path, 'w'){|f| f << file}
end
end
Expand Down

0 comments on commit be71a16

Please sign in to comment.