Skip to content

Commit

Permalink
new default: goto use regular stack names by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ninmonkey committed Nov 21, 2023
1 parent 918855c commit b2789af
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion private/safe_prompt.ps1
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ $tmpExport = @{
)
}

. (Get-Item -ea 'continue' 'C:\Users\cppmo_000\SkyDrive\Documents\2021\Powershell\My_Github\Ninmonkey.Console\prompt_block\prompt_blocks.ps1')
# . (Get-Item -ea 'continue' 'C:\Users\cppmo_000\SkyDrive\Documents\2021\Powershell\My_Github\Ninmonkey.Console\prompt_block\prompt_blocks.ps1')

$script:___promptInfo = @{
Current = '__prompt_noModuleLoaded'
20 changes: 13 additions & 7 deletions public/Set-NinLocation.ps1
Original file line number Diff line number Diff line change
@@ -71,9 +71,11 @@ function Set-NinLocation {
[Parameter()][switch]$AlwaysLsAfter
)
begin {
$StackName = @{
StackName = 'ninLocationStack'
}
# removed stack names, so that interacting with external
# location-functions act as normal
# function as normal
# $StackName = 'ninLocationStack'


# $UniPattern = @{
# Home = @(
@@ -151,13 +153,14 @@ function Set-NinLocation {
}

if ($Path -in @('-', '+')) {
Push-Location $Path @StackName
Push-Location $Path #@StackName
return
}

if ($Back) {
try {
Pop-Location -StackName 'NinLocation' -ea Stop
Pop-Location -ea 'stop'
# Pop-Location -ea 'Stop' -StackName 'NinLocation'
}
catch {
Write-Debug 'stack was empty'
@@ -178,7 +181,9 @@ function Set-NinLocation {
Write-Warning "Trying Parent, Path '$Path' did not Resolve: $_ . Did shellIntegration break prompt?"
$DestItem = Get-Item ($path | Split-Path )
}
$DestItem.PSPovider.Name | Join-String -op 'provider: ' | Write-Debug
$DestItem.PSPovider.Name
| Join-String -op 'provider: ' | Write-Debug

# see Test-IsDirectory
if ($DestItem.PSProvider.Name -ne 'filesystem') {
# I don't need to require FS,
@@ -210,7 +215,8 @@ function Set-NinLocation {

Write-Debug "Moving to: $DestItem"

Push-Location -Path $DestItem @stackname -PassThru
# Push-Location -Path $DestItem @stackname -PassThru
Push-Location -Path $DestItem -PassThru
| Label 'push -> ' | Write-Information


0 comments on commit b2789af

Please sign in to comment.