mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Fix brew rm
This commit is contained in:
parent
e9cb539445
commit
90c7029144
@ -80,9 +80,13 @@ class Keg
|
|||||||
end
|
end
|
||||||
|
|
||||||
def rm
|
def rm
|
||||||
|
# don't rmtree shit if we aren't positive about our location!
|
||||||
|
raise "Bad stuff!" unless path.parent.parent == $cellar
|
||||||
|
|
||||||
if path.directory?
|
if path.directory?
|
||||||
FileUtils.chmod_R 0777, path # ensure we have permission to delete
|
FileUtils.chmod_R 0777, path # ensure we have permission to delete
|
||||||
path.rmtree
|
path.rmtree # $cellar/foo/1.2.0
|
||||||
|
path.parent.rmdir if path.parent.children.length == 0 # $cellar/foo
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user