Skip to content

Commit 2c47351

Browse files
committed
make sure executable mode is set on binaries when using fast fix, update rvm/rvm#2894
1 parent 2bf7563 commit 2c47351

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/executable-hooks/regenerate_binstubs_command.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,14 @@ def try_to_fix_binstubs(spec)
6565
end
6666
return false if executable_shebangs.detect{|path, lines| !lines[0] =~ /^#!\// }
6767
puts "#{spec.name} #{spec.version}"
68+
executable_mode = 0111
6869
executable_shebangs.map do |path, lines|
6970
lines[0] = "#!#{ExecutableHooksInstaller.env_path} #{ExecutableHooks::Wrapper.expanded_wrapper_name}"
7071
File.open(path, "w") do |file|
7172
file.puts(lines)
7273
end
74+
mode = File.stat(path).mode
75+
File.chmod(mode | executable_mode, path) if mode & executable_mode != executable_mode
7376
end
7477
end
7578

0 commit comments

Comments
 (0)