private static void CreateAndStartCommand(string cmd, string arguments, bool waitAndExit)
{
SetEnvironmentVariable();
Settings.GitLog.Log(cmd + " " + arguments);
//process used to execute external commands
var process =
new Process
{
StartInfo =
{
UseShellExecute = true,
ErrorDialog = false,
RedirectStandardOutput = false,
RedirectStandardInput = false,
CreateNoWindow = false,
FileName = cmd,
Arguments = arguments,
WorkingDirectory = Settings.WorkingDir,
WindowStyle = ProcessWindowStyle.Normal,
LoadUserProfile = true
}
};
process.Start();
if (!waitAndExit)
return;
process.WaitForExit();
process.Close();
}