vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.32 vs vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.33

- old
+ new

@@ -196,12 +196,11 @@ app.urls = [url] else app.urls = [] end else - domain = client.target.sub(/^https?:\/\/[^\.]+\.(.+)\/?/, '\1') - app.urls = [input[:url, "#{name}.#{domain}"]] + app.urls = [input[:url, "#{name}.#{target_base}"]] end app.memory = megabytes(input[:memory, framework, runtime]) app = filter(:create_app, app) @@ -707,25 +706,21 @@ if app.started? && input[:restart] invoke :restart, :app => app end end - alias_command :set_env, :env_set - alias_command :set_env, :add_env - alias_command :set_env, :env_add - desc "Remove an environment variable" group :apps, :info, :hidden => true input :app, :argument => true, :desc => "Application to set the variable for", :from_given => by_name("app") input :name, :argument => true, :desc => "Environment variable name" input :restart, :type => :boolean, :default => true, :desc => "Restart app after updating?" - def delete_env(input) + def unset_env(input) app = input[:app] name = input[:name] with_progress("Updating #{c(app.name, :name)}") do app.env.delete(name) @@ -735,13 +730,11 @@ if app.started? && input[:restart] invoke :restart, :app => app end end - alias_command :delete_env, :env_del - desc "DEPRECATED. Use 'push' instead." input :app, :argument => :optional def update(input) fail "The 'update' command is no longer needed; use 'push' instead." end @@ -787,11 +780,15 @@ print " #{d(IS_UTF8 ? "\xc3\x97" : "x")} #{b(a.total_instances)}" print " instance#{a.total_instances == 1 ? "" : "s"}" line - unless a.urls.empty? + if a.urls.empty? + if v2? + line "urls: #{b("#{a.guid}.#{target_base}")}" + end + else line "urls: #{a.urls.collect { |u| b(u) }.join(", ")}" end unless a.services.empty? line "services: #{a.services.collect { |s| b(s.name) }.join(", ")}" @@ -973,8 +970,12 @@ return format("%.#{precision}f%s", num / unit, suf) end end format("%.#{precision}fB", num) + end + + def target_base + client.target.sub(/^https?:\/\/([^\.]+\.)?(.+)\/?/, '\2') end end end