aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-05-19 20:25:11 -0500
committerJack Nagel2013-05-19 20:25:11 -0500
commit45d69be9f2036fceaa7a99831ab1617f1b4bf971 (patch)
treecfa759c26d3ad556a053f7131c529d006a92389a /Library
parentab03bab094b7f4f669721b841801fe78558c2908 (diff)
downloadhomebrew-45d69be9f2036fceaa7a99831ab1617f1b4bf971.tar.bz2
brew-switch: simplify implementation
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmd/brew-switch.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Contributions/cmd/brew-switch.rb b/Library/Contributions/cmd/brew-switch.rb
index 6f6120189..5cfe86d63 100755
--- a/Library/Contributions/cmd/brew-switch.rb
+++ b/Library/Contributions/cmd/brew-switch.rb
@@ -21,14 +21,14 @@ end
unless (cellar+version).directory?
onoe "#{name} does not have a version \"#{version}\" in the Cellar."
- versions = cellar.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s }
+ versions = cellar.subdirs.map { |d| Keg.new(d).version }
puts "Versions available: #{versions.join(', ')}"
exit 3
end
# Unlink all existing versions
-cellar.children.select { |pn| pn.directory? }.each do |v|
+cellar.subdirs.each do |v|
keg = Keg.new(v)
puts "Cleaning #{keg}"
keg.unlink