diff --git a/lib/capistrano/symfony/defaults.rb b/lib/capistrano/symfony/defaults.rb index 20dd0f8..cf52558 100644 --- a/lib/capistrano/symfony/defaults.rb +++ b/lib/capistrano/symfony/defaults.rb @@ -51,3 +51,6 @@ # Assetic dump flags set :assetic_dump_flags, '' + +# SensioDistribution is version 5 or higher +set :sensio_distribution_version_5, false diff --git a/lib/capistrano/symfony/dsl/paths.rb b/lib/capistrano/symfony/dsl/paths.rb index 4a5ef20..ba69a23 100644 --- a/lib/capistrano/symfony/dsl/paths.rb +++ b/lib/capistrano/symfony/dsl/paths.rb @@ -24,6 +24,15 @@ def symfony_config_path release_path.join(fetch(:app_config_path)) end + def sensio_distribution_bootstrap_path + bootstrap_path = release_path.join('vendor/sensio/distribution-bundle/') + + unless fetch(:sensio_distribution_version_5) + bootstrap_path += 'Sensio/Bundle/DistributionBundle/' + end + + bootstrap_path += 'Resources/bin/build_bootstrap.php' + end end end end diff --git a/lib/capistrano/tasks/symfony.rake b/lib/capistrano/tasks/symfony.rake index d5de884..c94f9ec 100644 --- a/lib/capistrano/tasks/symfony.rake +++ b/lib/capistrano/tasks/symfony.rake @@ -87,7 +87,7 @@ namespace :symfony do task :build_bootstrap do on release_roles :all do within release_path do - execute :php, "./vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php", fetch(:app_path) + execute :php, sensio_distribution_bootstrap_path, fetch(:app_path) end end end