Skip to content

Commit

Permalink
Merge pull request #481 from diglin/master
Browse files Browse the repository at this point in the history
Allow to skip or not interactive_mode for the task capifony:doctrine:loa...
  • Loading branch information
willdurand committed Feb 20, 2014
2 parents ff8b64f + be80a6c commit 33b495a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/symfony2/doctrine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/capifony_symfony2_doctrine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 33b495a

Please sign in to comment.