gracefully handle 0 matches.
This commit is contained in:
parent
c59a690643
commit
2787a16a9f
|
@ -101,7 +101,11 @@ if __FILE__ == $0
|
||||||
end
|
end
|
||||||
|
|
||||||
package = nil
|
package = nil
|
||||||
if packages.length == 1
|
case packages.length
|
||||||
|
when 0
|
||||||
|
puts "No packages matched '#{name}'"
|
||||||
|
exit 1
|
||||||
|
when 1
|
||||||
package = packages.first
|
package = packages.first
|
||||||
else
|
else
|
||||||
packages.each_with_index do |package, index|
|
packages.each_with_index do |package, index|
|
||||||
|
|
Loading…
Reference in New Issue