nerushfgbhjkze4ghbieurzdh789izouehzbugk4789ziogh

This commit is contained in:
Mira 2024-01-20 13:52:52 +01:00
parent 8f4df05ac8
commit d2f03874f5
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36
11 changed files with 451 additions and 0 deletions

20
GetGitDir/Program.cs Normal file
View file

@ -0,0 +1,20 @@
try
{
if (!new FileInfo(".git").Exists)
return 1;
var content = File.ReadAllLines(".git");
if (!content.Any(x => x.StartsWith("gitdir: ")))
return 1;
var gitDirLine = content.First(x => x.StartsWith("gitdir: "));
Console.WriteLine(gitDirLine[8..]);
return 0;
}
catch (Exception)
{
return 1;
}