Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
brew unlink command
Browse files Browse the repository at this point in the history
Closes #8
  • Loading branch information
mxcl committed Aug 29, 2009
1 parent e2d937d commit 211404c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Library/Homebrew/keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ def uninstall
parent.rmdir_if_possible
end

def unlink
n=0
Pathname.new(self).find do |src|
next if src == self
dst=HOMEBREW_PREFIX+src.relative_path_from(self)
next unless dst.symlink?
dst.unlink
n+=1
Find.prune if src.directory?
end
n
end

def link
$n=0
$d=0
Expand Down
3 changes: 3 additions & 0 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ begin
when 'unlink'
ARGV.kegs.each {|keg| puts "#{keg.unlink} links removed for #{keg}"}

when 'unlink'
ARGV.kegs.each {|keg| puts "#{keg.unlink} links removed for #{keg}"}

when 'rm', 'uninstall', 'remove'
ARGV.kegs.each do |keg|
puts "Uninstalling #{keg}..."
Expand Down

0 comments on commit 211404c

Please sign in to comment.