feat(git-provider): Initial Show-GitRepo implementation
This commit is contained in:
parent
af5c9e43b6
commit
740d35d3e7
2 changed files with 60 additions and 0 deletions
|
|
@ -57,6 +57,21 @@ public class GitManager
|
|||
{
|
||||
return _registrations.Select(x => new GitReg() { Name = x.Value.Name, Location = x.Value.Location }).ToList();
|
||||
}
|
||||
|
||||
public string GetRepo(string? registeredName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(registeredName))
|
||||
{
|
||||
throw new Exception("Name cannot be null");
|
||||
}
|
||||
|
||||
if (_registrations.TryGetValue(registeredName, out var registration))
|
||||
{
|
||||
return registration.Location;
|
||||
}
|
||||
|
||||
throw new Exception($"No git repo has been registered with the name {registeredName}");
|
||||
}
|
||||
}
|
||||
|
||||
public class GitReg
|
||||
|
|
|
|||
Loading…
Reference in a new issue