Permalink
Browse files

verify Image Magick installed (only on Macs)

references #1511

Merges #1533
  • Loading branch information...
1 parent 2c3aa0f commit 101d4dbfc17a3231f4692bf9b9ff20f9d857f9f0 Daniel committed with radar May 13, 2012
Showing with 25 additions and 0 deletions.
  1. +25 −0 cmd/lib/spree_cmd/installer.rb
View
25 cmd/lib/spree_cmd/installer.rb
@@ -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 = {}
@@ -165,5 +172,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 101d4db

Please sign in to comment.