chore(git-provider): explore setting the location based on a child fragment match
This commit is contained in:
parent
dedea9213b
commit
1363f6ce02
2 changed files with 19 additions and 1 deletions
|
|
@ -61,6 +61,24 @@ public class GitProvider : NavigationCmdletProvider
|
|||
return true;
|
||||
}
|
||||
|
||||
protected override string MakePath(string parent, string child)
|
||||
{
|
||||
// Test to see what happens if set the location if the path matches a pretend repo registered with the name test
|
||||
// The result of the test is that yes, this does work, but there's also a shit load of calls to this method as
|
||||
// it traverses the entire directory path.
|
||||
// This seems to just be internal powershell behaviour so as long as this is quick the first time, everything
|
||||
// afterwards just always happens. But probably happens more seeing as I'm changing the location of the path
|
||||
// in this current SessionState and probably doesn't happen if this were a normal path traversal
|
||||
// where I don't set the location.
|
||||
if (child == "test")
|
||||
{
|
||||
SessionState.Path.SetLocation("F:/Repos/PowershellModule/src/PowershellModule/Git");
|
||||
return "F:/Repos/PowershellModule/src/PowershellModule/Git";
|
||||
}
|
||||
|
||||
return base.MakePath(parent, child);
|
||||
}
|
||||
|
||||
protected override bool IsValidPath(string path)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ public class NewGitRepoCommand : PSCmdlet
|
|||
|
||||
var repoFolfder = IsGitRepo(pwd);
|
||||
|
||||
|
||||
base.BeginProcessing();
|
||||
}
|
||||
|
||||
|
|
@ -114,6 +113,7 @@ public class SetGitRepoCommand : PSCmdlet
|
|||
|
||||
protected override void BeginProcessing()
|
||||
{
|
||||
SessionState.Path.SetLocation("F:/Repos/PowershellModule/src/PowershellModule/Git");
|
||||
base.BeginProcessing();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue