Skip to content
Snippets Groups Projects
Commit 357d0f27 authored by Jack Nagel's avatar Jack Nagel
Browse files

Use start_with? to simplify path sanity check

parent f438af99
No related branches found
No related tags found
No related merge requests found
......@@ -199,15 +199,7 @@ class Cmd
end
def keep? path
case path
when %r{^#{Regexp.escape(prefix)}}o, %r{^#{Regexp.escape(cellar)}}o, %r{^#{Regexp.escape(tmpdir)}}o
# maybe homebrew is installed to /sw or /opt/brew
true
when %r{^/opt}, %r{^/sw}, %r{/usr/X11}
false
else
true
end
path.start_with?(prefix, cellar, tmpdir) || !path.start_with?("/opt", "/sw", "/usr/X11")
end
def cflags
......
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