@@ -16,13 +16,15 @@ namespace :bundler do
1616 on fetch(:bundle_servers) do
1717 within release_path do
1818 with fetch(:bundle_env_variables) do
19+ config_args = fetch(:bundle_version, 2) >= 4 ? %w[config set] : %w[config]
20+
1921 configuration = fetch(:bundle_config).dup || {}
2022 configuration[:gemfile] = fetch(:bundle_gemfile)
2123 configuration[:path] = fetch(:bundle_path)
2224 configuration[:without] = fetch(:bundle_without)
2325
2426 configuration.each do |key, value|
25- execute :bundle, "config" , "--local", key, value.to_s.shellescape unless value.nil?
27+ execute :bundle, *config_args , "--local", key, value.to_s.shellescape unless value.nil?
2628 end
2729 end
2830 end
@@ -52,6 +54,8 @@ namespace :bundler do
5254 set :bundle_jobs, 4
5355 set :bundle_env_variables, {}
5456 set :bundle_clean_options, ""
57+ set :bundle_check_before_install, true
58+ set :bundle_version, 2
5559 DESC
5660 task install: :config do
5761 on fetch(:bundle_servers) do
@@ -124,5 +128,6 @@ namespace :load do
124128 set :bundle_env_variables, {}
125129 set :bundle_clean_options, ""
126130 set :bundle_check_before_install, true
131+ set :bundle_version, 2
127132 end
128133end
0 commit comments