From 4f268b3e379f3261d76955da0b24e6a446cf336f Mon Sep 17 00:00:00 2001 From: Patrick Bozeman Date: Thu, 29 Sep 2011 14:41:05 -0700 Subject: [PATCH] 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 --- dev_setup/bin/vcap_dev | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dev_setup/bin/vcap_dev b/dev_setup/bin/vcap_dev index 3b81cff..6cb91ba 100755 --- a/dev_setup/bin/vcap_dev +++ b/dev_setup/bin/vcap_dev @@ -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)