# Check whether SCM is installed 
# 

# DISABLE CHECK SCM for fast startup

# the SCM we care about, other options "svn"
# interested_scms = ["git"]
interested_scms = []

# save the SCM installed on the server, the glboal variable is used in BuildWise later
$supported_scms = {}

def check_svn
	begin
	  output = system("svn --version")
	  $supported_scms["subversion"] = true if output
	rescue => e
	  puts "error on checking svn: #{e}"
	end
end


def check_git
	begin
	  output = system("git --version")
	  $supported_scms["git"] = true if output
	rescue => e
	  puts "error on checking git: #{e}"
	end
end
  

unless ENV['RACK_ENV'] == "development"  
  check_git if interested_scms.include?("git")
  check_svn if interested_scms.include?("svn")  
end
