File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def install_from(full_gem_path)
35
35
bindir = calculate_bindir ( options )
36
36
destination = calculate_destination ( bindir )
37
37
38
- if File . exist? ( wrapper_path )
38
+ if File . exist? ( wrapper_path ) && ! same_file ( wrapper_path , destination )
39
39
FileUtils . mkdir_p ( bindir ) unless File . exist? ( bindir )
40
40
# exception based on Gem::Installer.generate_bin
41
41
raise Gem ::FilePermissionError . new ( bindir ) unless File . writable? ( bindir )
@@ -44,6 +44,12 @@ def install_from(full_gem_path)
44
44
end
45
45
end
46
46
47
+ def same_file ( file1 , file2 )
48
+ File . exist? ( file1 ) && File . exist? ( file2 ) &&
49
+ File . read ( file1 ) == File . read ( file2 )
50
+ end
51
+ private :same_file
52
+
47
53
def uninstall
48
54
destination = calculate_destination ( calculate_bindir ( options ) )
49
55
FileUtils . rm_f ( destination ) if File . exist? ( destination )
You can’t perform that action at this time.
0 commit comments