Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Fix build with clear_cache true
Browse files Browse the repository at this point in the history
  • Loading branch information
jdlehman committed Jan 27, 2017
1 parent b97acc4 commit e535c96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/slugbuilder/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def build(clear_cache: false, env: {}, prebuild: nil, postbuild: nil, slug_name:

def wipe_cache
FileUtils.rm_rf(@cache_dir)
FileUtils.mkdir_p(File.join(@cache_dir, 'buildpacks'))
end

def build_and_release
Expand Down
9 changes: 8 additions & 1 deletion spec/slugbuilder/builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@
end

it 'allows building without the cache' do
Slugbuilder.config.buildpacks = [
'https://github.com/heroku/heroku-buildpack-nodejs.git',
'https://github.com/heroku/heroku-buildpack-ruby.git'
]
builder.build
Slugbuilder.config.buildpacks = ['https://github.com/heroku/heroku-buildpack-nodejs.git']
builder.build(clear_cache: true)
expect(Dir.exists?('/tmp/slugbuilder-cache')).to be(false)
# make sure that ruby buildpack is no longer cached
expect(Dir['/tmp/slugbuilder-cache/buildpacks/*']).to eq(['/tmp/slugbuilder-cache/buildpacks/heroku-buildpack-nodejs'])
end

it 'accepts a prebuild Proc' do
Expand Down

0 comments on commit e535c96

Please sign in to comment.