Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
Fixed for compatibility with Berkshelf 2
Browse files Browse the repository at this point in the history
  • Loading branch information
iavael committed Jan 20, 2015
1 parent 05f5829 commit 9fa1315
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/knife-solo/berkshelf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ def install!
path = berkshelf_path
ui.msg "Installing Berkshelf cookbooks to '#{path}'..."

berkshelf_options = KnifeSolo::Tools.config_value(config, :berkshelf_options) || {}
berksfile = ::Berkshelf::Berksfile.from_file('Berksfile',berkshelf_options)
if defined?(::Berkshelf) && Gem::Version.new(::Berkshelf::VERSION) >= Gem::Version.new("3.0.0")
berkshelf_options = KnifeSolo::Tools.config_value(config, :berkshelf_options) || {}
berksfile = ::Berkshelf::Berksfile.from_file('Berksfile',berkshelf_options)
else
berksfile = ::Berkshelf::Berksfile.from_file('Berksfile')
end
if berksfile.respond_to?(:vendor)
FileUtils.rm_rf(path)
berksfile.vendor(path)
Expand Down

0 comments on commit 9fa1315

Please sign in to comment.