fixed the issue for powershell env variable
This commit is contained in:
parent
7113ccddea
commit
39380cdb33
|
|
@ -27,6 +27,12 @@ function global:__zoxide_pwd {
|
||||||
|
|
||||||
# cd + custom logic based on the value of _ZO_ECHO.
|
# cd + custom logic based on the value of _ZO_ECHO.
|
||||||
function global:__zoxide_cd($dir, $literal) {
|
function global:__zoxide_cd($dir, $literal) {
|
||||||
|
|
||||||
|
if ($dir.StartsWith('%') -and $dir.EndsWith('%')) {
|
||||||
|
$envVar = $dir.Trim('%')
|
||||||
|
$dir = $env:$envVar
|
||||||
|
}
|
||||||
|
|
||||||
$dir = if ($literal) {
|
$dir = if ($literal) {
|
||||||
Set-Location -LiteralPath $dir -Passthru -ErrorAction Stop
|
Set-Location -LiteralPath $dir -Passthru -ErrorAction Stop
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue