lib/sub/app.rb in sub-0.4.0 vs lib/sub/app.rb in sub-0.4.1
- old
+ new
@@ -73,31 +73,32 @@
:command => :up,
}
end
def execute
- puts self.send(@command)
+ result = self.send(@command)
+ puts result unless result.nil?
end
# commands
def up
if @args.empty?
@args = [`pwd`.chomp]
end
update_many(@args)
- "Update complete."
+ verbosity == QUIET ? nil : "Update complete."
end
def co
if @args.empty?
raise "Please specify a project to check out"
end
project = args.shift
dir_name = args.shift || project
svn("co #{base}/#{project}/trunk #{dir_name}")
- "Checkout complete."
+ verbosity == QUIET ? nil : "Checkout complete."
end
def base
url || ENV['SUB_BASE_URL'] || ENV['SVN'] || DEFAULT_BASE_URL
end
@@ -107,15 +108,19 @@
external_name = args.shift
if external_name.nil?
External.externals_of(dir).join("\n")
else
old_external = get_external(dir, external_name)
- if url || revision
+ if old_external.nil?
+ "No external found named #{external_name} in directory #{dir}" +
+ ((dir == '.') ? "\nDid you mean to use the --dir parameter?" : "")
+ elsif url || revision
revision_to_set = revision == 'HEAD' ? nil : revision
set_external(dir, external_name, url || old_external.url, revision_to_set)
else
old_external
end
+
end
end
def ignore
if args.empty?