Skip to content

Commit 94f3a5f

Browse files
committed
fix: ensure bundle install for pact_broker:dev:setup uses correct Gemfile
Closes: pact-foundation#243
1 parent 2e9c32a commit 94f3a5f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tasks/development.rake

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11

2+
desc 'Set up a dev instance of the Pact Broker'
23
task 'pact_broker:dev:setup' do
4+
puts "Copying example directory"
35
FileUtils.cp_r 'example', 'dev'
46
gemfile_contents = File.read('dev/Gemfile')
7+
8+
9+
puts "Changing source of pact_broker gem from rubygems.org to local file system"
510
new_gemfile_contents = gemfile_contents.gsub(/^.*gem.*pact_broker.*$/, "gem 'pact_broker', path: '../'")
611
File.open('dev/Gemfile', "w") { |file| file << new_gemfile_contents }
7-
bundle_install = "BUNDLE_GEMFILE=dev/Gemfile bundle install"
8-
puts bundle_install
9-
puts `#{bundle_install}`
12+
13+
Dir.chdir("dev") do
14+
Bundler.with_clean_env do
15+
puts "Executing bundle install"
16+
puts `bundle install`
17+
end
18+
end
1019
end

0 commit comments

Comments
 (0)