From 873f4dae9589ce9a512c13d945b7f06e728d4a4e Mon Sep 17 00:00:00 2001 From: Peter Mitchell Date: Sat, 16 Jan 2016 00:47:37 +0000 Subject: [PATCH] Support sensio distribution bundle v5 Closes #49 with credit to Dmitrii Korotovskii (@korotovsky) --- lib/capistrano/dsl/symfony.rb | 8 +++++++- lib/capistrano/symfony/defaults.rb | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/capistrano/dsl/symfony.rb b/lib/capistrano/dsl/symfony.rb index 3b32c41..064618d 100644 --- a/lib/capistrano/dsl/symfony.rb +++ b/lib/capistrano/dsl/symfony.rb @@ -39,7 +39,13 @@ def symfony_vendor_path end def build_bootstrap_path - symfony_vendor_path.join("sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php") + bootstrap_path = symfony_vendor_path.join("sensio/distribution-bundle") + + if fetch(:sensio_distribution_version).to_i <= 4 + bootstrap_path = bootstrap_path.join("Sensio/Bundle/DistributionBundle") + end + + bootstrap_path.join("Resources/bin/build_bootstrap.php") end def symfony_console(command, params = '') diff --git a/lib/capistrano/symfony/defaults.rb b/lib/capistrano/symfony/defaults.rb index 9cbef56..3050aa2 100644 --- a/lib/capistrano/symfony/defaults.rb +++ b/lib/capistrano/symfony/defaults.rb @@ -4,6 +4,7 @@ set :symfony_env, "prod" set :symfony_directory_structure, 2 +set :sensio_distribution_version, 4 # symfony-standard edition top-level directories set :app_path, "app"