mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
refactor: external tools and shells
* rename Models.ExternalMergeTools to Models.ExternalMerger * supports Git Bash/PowerShell/Command Prompt/Default Shell in Windows Terminal
This commit is contained in:
parent
4ac705f8ca
commit
4882fd9d69
19 changed files with 243 additions and 152 deletions
|
@ -21,7 +21,6 @@ namespace SourceGit.Native
|
|||
}
|
||||
|
||||
public static string GitExecutable { get; set; } = string.Empty;
|
||||
public static bool UsePowershellOnWindows { get; set; } = false;
|
||||
public static List<Models.ExternalTool> ExternalTools { get; set; } = new List<Models.ExternalTool>();
|
||||
|
||||
static OS()
|
||||
|
@ -46,6 +45,33 @@ namespace SourceGit.Native
|
|||
ExternalTools = _backend.FindExternalTools();
|
||||
}
|
||||
|
||||
public static Models.Shell GetShell()
|
||||
{
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
return (_backend as Windows).Shell;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Models.Shell.Default;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetShell(Models.Shell shell)
|
||||
{
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
var windows = (_backend as Windows);
|
||||
if (windows.Shell != shell)
|
||||
{
|
||||
windows.Shell = shell;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void SetupApp(AppBuilder builder)
|
||||
{
|
||||
_backend.SetupApp(builder);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue