fix -d without -n vcap_dev bug

This commit fixes a but that happens if you run vcap_dev
with a -d option but not a -n option.  (The old
code would leave options["name"] uninitialized)

Change-Id: I820a7fd5ce10f11af96b15f970d3a0b358fec49c
This commit is contained in:
Patrick Bozeman 2011-09-29 14:41:05 -07:00
Родитель e5c1b55155
Коммит 4f268b3e37
1 изменённых файлов: 7 добавлений и 8 удалений

Просмотреть файл

@ -22,14 +22,13 @@ opts = OptionParser.new do |opts|
end
opts.order!(ARGV)
if options.empty?
options["name"], options["home"] = Deployment.get_deployment_target
if options["name"]
puts "Targeting deployment \"#{options["name"]}\" with cloudfoundry home \"#{options["home"]}\""
else
options["name"] ||= DEPLOYMENT_DEFAULT_NAME
puts "Targeting default deployment \"#{options["name"]}\""
end
options["name"], options["home"] = Deployment.get_deployment_target if options.empty?
if options["name"]
puts "Targeting deployment \"#{options["name"]}\" with cloudfoundry home \"#{options["home"]}\""
else
options["name"] = DEPLOYMENT_DEFAULT_NAME
puts "Targeting default deployment \"#{options["name"]}\""
end
if ARGV[0].nil? || !%w[start stop restart tail status].include?(ARGV[0].downcase)