feat: Add GitRepoRegistration cmdlets #5

Merged
pascal_nulah merged 69 commits from feature/git-provider into dev 2026-09-06 09:33:36 +10:00
2 changed files with 29 additions and 1 deletions
Showing only changes of commit 1b09d15937 - Show all commits

feat(git-provider): More placeholder overrides for future use

Scott 2026-08-06 15:31:17 +10:00

View file

@ -16,16 +16,20 @@ public class GitProvider : NavigationCmdletProvider
protected override PSDriveInfo NewDrive(PSDriveInfo drive)
{
// This is a bit of a hack to ensure that no drive is registered with a root location.
// It seems to be how PSDrives are registered for Alias providers, and we technically don't have any concept
// of a normal file system
if (drive.Root != string.Empty)
{
throw new Exception("Drive root must be an empty string");
}
return base.NewDrive(drive);
}
protected override void NewItem(string path, string itemTypeName, object newItemValue)
{
base.NewItem(path, itemTypeName, newItemValue);
//base.NewItem(path, itemTypeName, newItemValue);
}
protected override PSDriveInfo RemoveDrive(PSDriveInfo drive)
@ -33,6 +37,18 @@ public class GitProvider : NavigationCmdletProvider
return base.RemoveDrive(drive);
}
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
// TODO: get all configured repos based on a path from the underlying GitPsDriveInfo then
// output their repository names
}
protected override void GetChildItems(string path, bool recurse)
{
// TODO: get all configured repos based on a path from the underlying GitPsDriveInfo then
// output their repository locations and any other meta data I store
}
// I think this is needed to be able to cd into it
protected override bool IsItemContainer(string path)
{

View file

@ -0,0 +1,12 @@
using System.Management.Automation;
namespace PowershellModule.Git;
public class GitPsDriveInfo : PSDriveInfo
{
protected GitPsDriveInfo(PSDriveInfo driveInfo)
: base(driveInfo)
{
}
}