vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.41 vs vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.42
- old
+ new
@@ -207,11 +207,11 @@
with_progress("Creating #{c(app.name, :name)}") do
app.create!
end
- invoke :map, :app => app, :url => url if v2?
+ invoke :map, :app => app, :url => url if url && v2?
bindings = []
if input[:create_services] && !force?
while true
@@ -504,12 +504,10 @@
:desc => "Application to inspect the files of",
:from_given => by_name("app")
input :path, :argument => true, :default => "/",
:desc => "Path of file to read"
def file
- no_v2
-
app = input[:app]
file =
with_progress("Getting file contents") do
app.file(*input[:path].split("/"))
@@ -526,12 +524,10 @@
:desc => "Application to inspect the files of",
:from_given => by_name("app")
input :path, :argument => true, :default => "/",
:desc => "Path of directory to list"
def files
- no_v2
-
app = input[:app]
files =
with_progress("Getting file listing") do
app.files(*input[:path].split("/"))
@@ -616,17 +612,21 @@
simple = input[:url].sub(/^https?:\/\/(.*)\/?/i, '\1')
if v2?
host, domain_name = simple.split(".", 2)
+ domain =
+ client.current_space.domains.find { |d|
+ d.name == domain_name
+ }
+
+ fail "Invalid domain '#{domain_name}'" unless domain
+
route = client.routes.find { |r|
- r.host == host && r.domain.name == domain_name
+ r.host == host && r.domain == domain
}
unless route
- domain = client.domain_by_name(domain_name)
- fail "Invalid domain '#{domain_name}'" unless domain
-
route = client.route
with_progress("Creating route #{c(simple, :name)}") do
route.host = host
route.domain = domain