From c18564d2cbbffa5d15d2ead97ba0fc4623f77e07 Mon Sep 17 00:00:00 2001 From: Sato Hiroyuki Date: Thu, 6 Jun 2013 10:10:51 +0900 Subject: Fix abort gitlab:app:check When the file that pointed git bin_path in gitlab.yml dose'nt exist, bundle rake gitlab:app:check would be aborted. refs #4205 --- lib/gitlab/version_info.rb | 2 +- lib/tasks/gitlab/check.rake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/version_info.rb b/lib/gitlab/version_info.rb index 31b72720972..6ee41e85cc9 100644 --- a/lib/gitlab/version_info.rb +++ b/lib/gitlab/version_info.rb @@ -5,7 +5,7 @@ module Gitlab attr_reader :major, :minor, :patch def self.parse(str) - if m = str.match(/(\d+)\.(\d+)\.(\d+)/) + if str && m = str.match(/(\d+)\.(\d+)\.(\d+)/) VersionInfo.new(m[1].to_i, m[2].to_i, m[3].to_i) else VersionInfo.new diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 59c2449444a..c1815b7eee7 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -659,7 +659,7 @@ namespace :gitlab do current_version = Gitlab::VersionInfo.parse(gitlab_shell_version) print "GitLab Shell version >= #{required_version} ? ... " - if required_version <= current_version + if current_version.valid? && required_version <= current_version puts "OK (#{current_version})".green else puts "FAIL. Please update gitlab-shell to #{required_version} from #{current_version}".red @@ -673,7 +673,7 @@ namespace :gitlab do puts "Your git bin path is \"#{Gitlab.config.git.bin_path}\"" print "Git version >= #{required_version} ? ... " - if required_version <= current_version + if current_version.valid? && required_version <= current_version puts "yes (#{current_version})".green else puts "no".red -- cgit v1.2.1