Browse Source

Handle exception if `git` is not found

pull/1915/head
duckdoom5 4 months ago
parent
commit
307f720ef5
  1. 9
      src/Generator/Utils/Utils.cs

9
src/Generator/Utils/Utils.cs

@ -84,7 +84,7 @@ namespace CppSharp @@ -84,7 +84,7 @@ namespace CppSharp
{
while (stringBuilder.Length > 0 && stringBuilder[0] == '_')
stringBuilder.Remove(0, 1);
while (stringBuilder.Length > 0 && stringBuilder[stringBuilder.Length - 1] == '_')
while (stringBuilder.Length > 0 && stringBuilder[^1] == '_')
stringBuilder.Remove(stringBuilder.Length - 1, 1);
}
}
@ -135,6 +135,8 @@ namespace CppSharp @@ -135,6 +135,8 @@ namespace CppSharp
public static class GeneratorHelpers
{
public static NewLineType? GetNewLineTypeFromGitConfig(string outputDir)
{
try
{
if (!bool.TryParse(
ProcessHelper.RunFrom(outputDir,
@ -178,5 +180,10 @@ namespace CppSharp @@ -178,5 +180,10 @@ namespace CppSharp
_ => null
};
}
catch (Exception)
{
return null;
}
}
}
}

Loading…
Cancel
Save