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

Enable support for macOS 10.12 Sierra #498

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/knife-solo/bootstraps/darwin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@ def issue

def distro
case issue
when %r{10.(?:[6-9]|10)}
when %r{10.(?:[6-9]|1[0-2])}
{:type => 'omnibus'}
else
raise "OS X version #{issue} not supported"
end
end

def bootstrap!
super
if issue.split('.')[1].to_i >= 11
# El Capitan and beyond do not have /usr/local/bin in the default paths,
# which is where chef gets installed.
path = "/usr/local/bin"
path_command = "[[ $PATH == *#{path}* ]] || echo 'export PATH=#{path}:$PATH' >> ~/.bashrc"
run_command(path_command)
end
end
end
end
4 changes: 4 additions & 0 deletions lib/knife-solo/resources/solo.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ cookbook_path << File.join(base, 'cookbooks-<%= i+1 %>') # <%= path %>
<% proxy_settings.each_pair do |k, v| -%>
<%= k %> "<%= v %>"
<% end -%>

# If the TMPDIR is not world-readable, set it to a location that is. This is
# necessary so that `script` resources can complete as non-root users on macOS.
ENV['TMPDIR'] = "/tmp"