Skip to content

Commit

Permalink
Fix working dir bug when composer:run is executed directly via the CLI
Browse files Browse the repository at this point in the history
When not running via a deploy (e.g. composer:run executed directly via CLI), the command fails because
the release_path variable is not set. It's only set as part of a deploy.

This fix changes the way composer:run works: when not executed within the context of a deploy, Composer's
working directory will be set to current_path instead of release_path.

This is a backwards-compatible bugfix, but it might be worth bumping at least minor version because
behavior changes considerably for end-users.
  • Loading branch information
gsomoza committed Oct 30, 2018
1 parent 876298a commit e0b0ff2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capistrano/tasks/composer.rake
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace :load do
task :defaults do
set :composer_install_flags, '--no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader'
set :composer_roles, :all
set :composer_working_dir, -> { release_path }
set :composer_working_dir, -> { release_path || current_path }
set :composer_dump_autoload_flags, '--optimize'
set :composer_download_url, "https://getcomposer.org/installer"
end
Expand Down

0 comments on commit e0b0ff2

Please sign in to comment.