diff options
| author | Jack Nagel | 2013-05-19 20:25:11 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-05-19 20:25:11 -0500 |
| commit | cd35fc3bbd4a51264da5cd6fcb97b1bc6bdadcd1 (patch) | |
| tree | fa45457569061f384c5a5284b1939e7d948a0d51 /Library/Contributions | |
| parent | 6fa64da7f3255dc98612534cec971a41931b5ed1 (diff) | |
| download | brew-cd35fc3bbd4a51264da5cd6fcb97b1bc6bdadcd1.tar.bz2 | |
brew-switch: simplify implementation
Diffstat (limited to 'Library/Contributions')
| -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 |
