diff options
| author | Jack Nagel | 2013-05-19 20:25:11 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-05-19 20:25:11 -0500 |
| commit | 45d69be9f2036fceaa7a99831ab1617f1b4bf971 (patch) | |
| tree | cfa759c26d3ad556a053f7131c529d006a92389a /Library | |
| parent | ab03bab094b7f4f669721b841801fe78558c2908 (diff) | |
| download | homebrew-45d69be9f2036fceaa7a99831ab1617f1b4bf971.tar.bz2 | |
brew-switch: simplify implementation
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/cmd/brew-switch.rb | 4 |
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 |
