nerushfgbhjkze4ghbieurzdh789izouehzbugk4789ziogh
This commit is contained in:
parent
8f4df05ac8
commit
d2f03874f5
11 changed files with 451 additions and 0 deletions
20
GetGitDir/Program.cs
Normal file
20
GetGitDir/Program.cs
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue