Esempio n. 1
0
 private void SetTitleToGitVersion()
 {
     try
     {
         string output = ProgramPathFinder.ExecuteAndGetOutput(ProgramPathFinder.GetGitBin(),
                                                               "--version");
         this.Title += " - " + output;
     }
     catch (System.IO.FileNotFoundException ex)
     {
         UIService.ShowMessage(ex.Message);
         System.Environment.Exit(1);
     }
 }
Esempio n. 2
0
        static public string GetSignature()
        {
            RunExternal   runner       = new RunExternal(ProgramPathFinder.GetGitBin(), ".");
            List <string> outputs      = runner.Run("config --list");
            string        name_prefix  = "user.name=";
            string        name         = "unknown";
            string        email_prefix = "user.email=";
            string        email        = "*****@*****.**";

            foreach (string output in outputs)
            {
                if (output.StartsWith(name_prefix))
                {
                    name = output.Substring(name_prefix.Length);
                }
                if (output.StartsWith(email_prefix))
                {
                    email = output.Substring(email_prefix.Length);
                }
            }
            return(string.Format("{0} <{1}>", name, email));
        }
Esempio n. 3
0
        private RunExternal CreateGitRunner()
        {
            RunExternal runner = new RunExternal(ProgramPathFinder.GetGitBin(), path_);

            return(runner);
        }