using System;
using System.Diagnostics;
namespace FastGithub.ReverseProxy
{
    /// 
    /// git工具
    /// 
    static class GitUtil
    {
        /// 
        /// 设置ssl验证
        /// 
        /// 是否验证
        /// 
        public static bool ConfigSslverify(bool value)
        {
            try
            {
                Process.Start(new ProcessStartInfo
                {
                    FileName = "git",
                    Arguments = $"config --global http.sslverify {value.ToString().ToLower()}",
                    UseShellExecute = true,
                    CreateNoWindow = true,
                    WindowStyle = ProcessWindowStyle.Hidden
                });
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
    }
}