diff --git a/lib/homesick/actions/git_actions.rb b/lib/homesick/actions/git_actions.rb index 0e2a746..c7fb85b 100644 --- a/lib/homesick/actions/git_actions.rb +++ b/lib/homesick/actions/git_actions.rb @@ -11,7 +11,7 @@ module Homesick } STRING = MIN_VERSION.values.join('.') - def version_check + def git_version_correct? info = `git --version`.scan(/(\d+)\.(\d+)\.(\d+)/).flatten.map(&:to_i) return false unless info.count == 3 current_version = Hash[ [:major, :minor, :patch].zip(info) ] diff --git a/lib/homesick/cli.rb b/lib/homesick/cli.rb index 2e2eeab..8754031 100644 --- a/lib/homesick/cli.rb +++ b/lib/homesick/cli.rb @@ -20,7 +20,7 @@ module Homesick def initialize(args = [], options = {}, config = {}) super # Check if git is installed - unless version_check + unless git_version_correct? say_status :error, "Git version >= #{Homesick::Actions::GitActions::STRING} must be installed to use Homesick", :red exit(1) end