Skip to content

Commit

Permalink
Use -print-last-dir option for lfcd.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
alunegov committed Nov 7, 2023
1 parent f6e7d0f commit 46524b1
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions etc/lfcd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,4 @@
# You may put this in one of the profiles found in $PROFILE.
#

$tmp = [System.IO.Path]::GetTempFileName()
lf -last-dir-path="$tmp" $args
if (Test-Path -PathType Leaf "$tmp") {
$dir = Get-Content "$tmp"
Remove-Item -Force "$tmp"
if (Test-Path -PathType Container "$dir") {
if ("$dir" -ne "$pwd") {
cd "$dir"
}
}
}
lf -print-last-dir $args | cd

0 comments on commit 46524b1

Please sign in to comment.