feat(git-provider): More placeholder overrides for future use
This commit is contained in:
parent
05d6eece99
commit
1b09d15937
2 changed files with 29 additions and 1 deletions
|
|
@ -16,16 +16,20 @@ public class GitProvider : NavigationCmdletProvider
|
||||||
|
|
||||||
protected override PSDriveInfo NewDrive(PSDriveInfo drive)
|
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)
|
if (drive.Root != string.Empty)
|
||||||
{
|
{
|
||||||
throw new Exception("Drive root must be an empty string");
|
throw new Exception("Drive root must be an empty string");
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.NewDrive(drive);
|
return base.NewDrive(drive);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void NewItem(string path, string itemTypeName, object newItemValue)
|
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)
|
protected override PSDriveInfo RemoveDrive(PSDriveInfo drive)
|
||||||
|
|
@ -33,6 +37,18 @@ public class GitProvider : NavigationCmdletProvider
|
||||||
return base.RemoveDrive(drive);
|
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
|
// I think this is needed to be able to cd into it
|
||||||
protected override bool IsItemContainer(string path)
|
protected override bool IsItemContainer(string path)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
12
src/PowershellModule/Git/GitPsDriveInfo.cs
Normal file
12
src/PowershellModule/Git/GitPsDriveInfo.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System.Management.Automation;
|
||||||
|
|
||||||
|
namespace PowershellModule.Git;
|
||||||
|
|
||||||
|
public class GitPsDriveInfo : PSDriveInfo
|
||||||
|
{
|
||||||
|
protected GitPsDriveInfo(PSDriveInfo driveInfo)
|
||||||
|
: base(driveInfo)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue