lib/tasks/publish.rake in daddy-0.1.9 vs lib/tasks/publish.rake in daddy-0.1.11

- old
+ new

@@ -2,13 +2,13 @@ require 'daddy/git' namespace :dad do task :publish do - fail('環境編集 TITLE を指定してください。') unless ENV['TITLE'] and not ENV['TITLE'].blank? + fail('環境編集 TITLE を指定してください。') unless ENV['TITLE'] and not ENV['TITLE'].empty? - if File.exist?("#{Rails.root}/db/schema.rb") + if File.exist?("db/schema.rb") fail unless system("bundle exec rake db:schema:load RAILS_ENV=test") end system("mkdir -p features/reports") system("rm -Rf features/reports/*") @@ -35,10 +35,12 @@ system("sudo chown -R #{ENV['USER']}:#{ENV['USER']} #{dir}") system("mkdir -p #{dir}/#{current_branch}") system("rm -Rf #{dir}/#{current_branch}/*") system("cp -Rf features/reports/* #{dir}/#{current_branch}/") - system("cp -Rf coverage #{dir}/#{current_branch}/") + if File.exist? 'coverage' + system("cp -Rf coverage #{dir}/#{current_branch}/") + end end end def self.title_to_dirname(title)