Skip to content

Commit

Permalink
Ensure brew exists before running outdated check
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Jul 31, 2012
1 parent 7e64533 commit 87e875b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions homebrew/recipes/upgrade.rb
@@ -1,8 +1,10 @@
include_recipe "homebrew"

`#{node[:homebrew][:prefix]}/bin/brew outdated`.lines.each do |line|
package line.chomp do
action :upgrade
notifies :run, resources(:execute => "brew cleanup"), :delayed
if File.exist?("#{node[:homebrew][:prefix]}/bin/brew")
`#{node[:homebrew][:prefix]}/bin/brew outdated`.lines.each do |line|
package line.chomp do
action :upgrade
notifies :run, resources(:execute => "brew cleanup"), :delayed
end
end
end

0 comments on commit 87e875b

Please sign in to comment.