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

Commit

Permalink
Enable support for macOS 10.12 Sierra
Browse files Browse the repository at this point in the history
  • Loading branch information
CGamesPlay committed Mar 31, 2017
1 parent baa77a5 commit f813f54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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"

0 comments on commit f813f54

Please sign in to comment.