Skip to content
Snippets Groups Projects
Commit fe29cc29 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

cleaner: port to generic OS. (#447)

parent 883b201c
No related branches found
No related tags found
No related merge requests found
...@@ -66,6 +66,10 @@ class Cleaner ...@@ -66,6 +66,10 @@ class Cleaner
end end
end end
def executable_path?(path)
path.text_executable?
end
# Clean a top-level (bin, sbin, lib) directory, recursively, by fixing file # Clean a top-level (bin, sbin, lib) directory, recursively, by fixing file
# permissions and removing .la files, unless the files (or parent # permissions and removing .la files, unless the files (or parent
# directories) are protected by skip_clean. # directories) are protected by skip_clean.
...@@ -87,7 +91,7 @@ class Cleaner ...@@ -87,7 +91,7 @@ class Cleaner
path.unlink path.unlink
else else
# Set permissions for executables and non-executables # Set permissions for executables and non-executables
perms = if path.mach_o_executable? || path.text_executable? perms = if executable_path?(path)
0555 0555
else else
0444 0444
...@@ -103,3 +107,5 @@ class Cleaner ...@@ -103,3 +107,5 @@ class Cleaner
end end
end end
end end
require "extend/os/cleaner"
require "cleaner"
if OS.mac?
require "extend/os/mac/cleaner"
end
class Cleaner
private
def executable_path?(path)
path.mach_o_executable? || path.text_executable?
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment