Skip to content

Commit

Permalink
verify Image Magick installed (only on Macs)
Browse files Browse the repository at this point in the history
references #1511

Merges #1533
  • Loading branch information
Daniel authored and radar committed May 22, 2012
1 parent e286228 commit 078d906
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cmd/lib/spree_cmd/installer.rb
Expand Up @@ -32,6 +32,13 @@ def verify_rails
end
end

def verify_image_magick
unless image_magick_installed?
say "Image magick must be installed."
exit(1)
end
end

def prepare_options
@spree_gem_options = {}

Expand Down Expand Up @@ -160,5 +167,23 @@ def create_rails_app
def is_rails_project?
File.exists? File.join(@app_path, 'script', 'rails')
end

def is_mac?
Object::RUBY_PLATFORM =~ /(darwin)/i ? true: false
end

def image_magick_installed?
if is_mac?
begin
%x(identify -version)
rescue
end

$?.success?
else
# not sure how to check on windows so assume installed
true
end
end
end
end

0 comments on commit 078d906

Please sign in to comment.