Skip to content

Commit

Permalink
updates to make the executable a little more aware of what it needs
Browse files Browse the repository at this point in the history
  • Loading branch information
atmos committed May 28, 2010
1 parent b7314bb commit fcb7471
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions bin/cider
Expand Up @@ -10,6 +10,29 @@ ENV['EMAIL'] ||= 'noreploy@gmail.com'
ENV['EDITOR'] ||= 'vim'
ENV['FULLNAME'] ||= 'Marlon Brando'

RECOMMENDED_LLVM = 2206
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f

if MACOS_VERSION >= 10.6
begin
xcode_path = `/usr/bin/xcode-select -print-path`.chomp
return nil if xcode_path.empty?
if `#{xcode_path}/usr/bin/llvm-gcc-4.2 -v 2>&1` =~ /LLVM build (\d{4,})/
if $1.to_i < RECOMMENDED_LLVM
$stderr.puts "You should really upgrade your xcode install"
end
end
rescue
$stderr.puts "You need xcode for this to work :\\"
exit(1)
end
else
$stderr.puts "You should really upgrade to snow leopard"
$stderr.puts "Make sure you have xcode installed and cross your fingers"
$stderr.puts "I've seen it work on leopard though..."
end

Cider::Runner.run

# vim:ft=ruby
1 change: 1 addition & 0 deletions lib/cider.rb
Expand Up @@ -11,6 +11,7 @@ def self.run
def run
system("rm -rf ~/.cider")
system("chef-solo -c #{config}")
exit($?)
end

def config
Expand Down

0 comments on commit fcb7471

Please sign in to comment.