Skip to content

Commit

Permalink
Display an error message if not run from the root of the project, #186
Browse files Browse the repository at this point in the history
  • Loading branch information
cuong-now committed May 26, 2014
1 parent d84a973 commit d54e772
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/annotate
@@ -1,4 +1,9 @@
#!/usr/bin/env ruby

unless File.exists?('./Rakefile') || File.exists?('./Gemfile')
abort "Please run annotate from the root of the project."
end

require 'rubygems'
begin
require 'bundler'
Expand Down Expand Up @@ -146,7 +151,6 @@ OptionParser.new do |opts|

end.parse!


options=Annotate.setup_options({ :is_rake => !ENV['is_rake'].blank? })
options = Annotate.setup_options({ :is_rake => ENV['is_rake'] && !ENV['is_rake'].empty? })
Annotate.eager_load(options)
target[:klass].send(target[:task], options)

0 comments on commit d54e772

Please sign in to comment.