Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Detect when an invalid task name is used (by capturing STDERR) and ex…

…it with a friendly message
  • Loading branch information...
commit c0673f16d59d15c2dc3a4f2665da58156886d4c1 1 parent 7b48265
@chrisk authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 bin/livelydocs
View
8 bin/livelydocs
@@ -14,7 +14,13 @@ task_name = ARGV.shift
t = Thread.start do
loop do
- result = `rake -s #{task_name || "rdoc"}`
+ result = `rake -s #{task_name || "rdoc"} 2>&1`
+
+ if result =~ /Don't know how to build task '#{task_name}'/
+ puts "** The '#{task_name}' task couldn't be found. To use another task: #{$0} [task]"
+ break
+ end
+
puts result unless result.strip.empty?
sleep(1)
end
Please sign in to comment.
Something went wrong with that request. Please try again.