Skip to content

Commit

Permalink
Do not display error when requiring rake task
Browse files Browse the repository at this point in the history
Instead, only show missing Appraisals file error when user execute
`bin/appraisal`.
  • Loading branch information
sikachu committed Apr 2, 2014
1 parent 73770b7 commit 436092a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
7 changes: 6 additions & 1 deletion bin/appraisal
Expand Up @@ -4,4 +4,9 @@ require 'bundler/setup'
require 'appraisal'
require 'appraisal/cli'

Appraisal::CLI.start
begin
Appraisal::CLI.start
rescue Appraisal::AppraisalsNotFound => e
puts e.message
exit 127
end
17 changes: 10 additions & 7 deletions lib/appraisal/task.rb
Expand Up @@ -28,14 +28,17 @@ def initialize
exec 'bundle exec appraisal clean'
end

File.each do |appraisal|
desc "DEPRECATED: Run the given task for appraisal #{appraisal.name}"
task appraisal.name do
ARGV.shift
warn "`rake appraisal:#{appraisal.name}` task is deprecated and will be removed soon. " +
"Please use `appraisal #{appraisal.name} rake #{ARGV.join(' ')}`."
exec "bundle exec appraisal #{appraisal.name} rake #{ARGV.join(' ')}"
begin
File.each do |appraisal|
desc "DEPRECATED: Run the given task for appraisal #{appraisal.name}"
task appraisal.name do
ARGV.shift
warn "`rake appraisal:#{appraisal.name}` task is deprecated and will be removed soon. " +
"Please use `appraisal #{appraisal.name} rake #{ARGV.join(' ')}`."
exec "bundle exec appraisal #{appraisal.name} rake #{ARGV.join(' ')}"
end
end
rescue AppraisalsNotFound
end

task :all do
Expand Down

0 comments on commit 436092a

Please sign in to comment.