From d54e772aad1fe05773add7a1b3e0789c30e197c3 Mon Sep 17 00:00:00 2001 From: "cuong.tran" Date: Mon, 26 May 2014 16:25:54 -0700 Subject: [PATCH] Display an error message if not run from the root of the project, #186 --- bin/annotate | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/annotate b/bin/annotate index 4079c21f0..035160369 100755 --- a/bin/annotate +++ b/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' @@ -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)