lib/bushido/app.rb in bushido-0.0.11 vs lib/bushido/app.rb in bushido-0.0.12

- old
+ new

@@ -48,15 +48,21 @@ end def add_var(key, value) put :add_var, {:key => key, :value => value} + if Bushido::Command.last_command_successful? + ENV[key.upcase] = value + end end def remove_var(key) put :remove_var, {:key => key} + if Bushido::Command.last_command_successful? + ENV[key.upcase] = nil + end end def domains get()["app"]["domains"] @@ -76,20 +82,27 @@ end end def set_subdomain(subdomain) - put :set_subdomain, {:subdomain => subdomain} + result = put :set_subdomain!, {:subdomain => subdomain} + if Bushido::Command.last_command_successful? + ENV["BUSHIDO_SUBDOMAIN"] = subdomain + ENV["PUBLIC_URL"] = "http://#{subdomain}.#{ENV['APP_TLD']}/" + return result + end + + result end def add_domain(domain) - put :add_domain, {:domain => domain} + put :add_domain!, {:domain => domain} end def remove_domain(domain) - put :remove_domain, {:domain => domain} + put :remove_domain!, {:domain => domain} end def clear_log!(name) put :clear_log!, {:name => name}