nerushfgbhjkze4ghbieurzdh789izouehzbugk4789ziogh
This commit is contained in:
parent
8f4df05ac8
commit
d2f03874f5
11 changed files with 451 additions and 0 deletions
18
GetGitDir/GetGitDir.csproj
Normal file
18
GetGitDir/GetGitDir.csproj
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
BIN
GetGitDir/GetGitDir.exe
Normal file
BIN
GetGitDir/GetGitDir.exe
Normal file
Binary file not shown.
25
GetGitDir/GetGitDir.sln
Normal file
25
GetGitDir/GetGitDir.sln
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34511.84
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetGitDir", "GetGitDir.csproj", "{13C3220F-81E4-46E1-9D45-BFE51D425C7A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{13C3220F-81E4-46E1-9D45-BFE51D425C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{13C3220F-81E4-46E1-9D45-BFE51D425C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{13C3220F-81E4-46E1-9D45-BFE51D425C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{13C3220F-81E4-46E1-9D45-BFE51D425C7A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F57CB7EB-01A8-4A5D-ABDF-F6A655B99AE5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
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