Use start_with? to simplify path sanity check
This commit is contained in:
parent
f438af9915
commit
357d0f2796
@ -199,15 +199,7 @@ class Cmd
|
|||||||
end
|
end
|
||||||
|
|
||||||
def keep? path
|
def keep? path
|
||||||
case path
|
path.start_with?(prefix, cellar, tmpdir) || !path.start_with?("/opt", "/sw", "/usr/X11")
|
||||||
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def cflags
|
def cflags
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user