From ade9e986e54bddd29301c88b798087b5b53db381 Mon Sep 17 00:00:00 2001 From: Alexander Lunegov Date: Wed, 8 Nov 2023 17:16:01 +0500 Subject: [PATCH] Use `-print-last-dir` option for `lfcd.ps1` (#1491) * Use `-print-last-dir` option for `lfcd.ps1` * chore(etc/lfcd.ps1): use `Set-Location` instead of `cd` Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com> --------- Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com> --- etc/lfcd.ps1 | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/etc/lfcd.ps1 b/etc/lfcd.ps1 index 458cf772..69997520 100644 --- a/etc/lfcd.ps1 +++ b/etc/lfcd.ps1 @@ -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 | Set-Location