Permalink
Browse files

Allow to skip or not interactive_mode for the task capifony:doctrine:…

…load:fixtures
  • Loading branch information...
1 parent ff8b64f commit be80a6c6169a309767d140f0af000d770d09e5d7 @diglin diglin committed Feb 20, 2014
Showing with 6 additions and 3 deletions.
  1. +4 −1 lib/symfony2/doctrine.rb
  2. +2 −2 spec/capifony_symfony2_doctrine_spec.rb
View
@@ -94,7 +94,10 @@
desc "Load data fixtures"
task :load_fixtures, :roles => :app, :except => { :no_release => true } do
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:fixtures:load #{console_options}#{doctrine_em_flag}'", :once => true
+ if !interactive_mode || Capistrano::CLI.ui.agree("Careful, database will be purged. Do you want to continue? (Y/N)")
+ run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:fixtures:load --no-interaction #{console_options}#{doctrine_em_flag}'", :once => true
+ end
+ capifony_puts_ok
end
namespace :migrations do
@@ -108,7 +108,7 @@
@configuration.find_and_execute_task('symfony:doctrine:load_fixtures')
end
- it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:fixtures:load --env=prod --no-debug\'') }
+ it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:fixtures:load --no-interaction --env=prod --no-debug\'') }
end
it "defines symfony:doctrine:migrations tasks" do
@@ -204,7 +204,7 @@
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:schema:create --env=prod --no-debug --em=custom_em\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:schema:drop --force --env=prod --no-debug --em=custom_em\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:schema:update --force --env=prod --no-debug --em=custom_em\'') }
- it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:fixtures:load --env=prod --no-debug --em=custom_em\'') }
+ it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:fixtures:load --no-interaction --env=prod --no-debug --em=custom_em\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:migrations:status --env=prod --no-debug --em=custom_em\'') }
end

0 comments on commit be80a6c

Please sign in to comment.