mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-25 22:17:33 +00:00
Rename $result to $_zoxide_result to avoid conflicts (#87)
This commit is contained in:
parent
664b95d601
commit
5c107c23cf
@ -41,13 +41,13 @@ function {}
|
|||||||
else
|
else
|
||||||
# FIXME: use string-collect from fish 3.1.0 once it has wider adoption
|
# FIXME: use string-collect from fish 3.1.0 once it has wider adoption
|
||||||
set -l IFS ''
|
set -l IFS ''
|
||||||
set -l result (zoxide query $argv)
|
set -l _zoxide_result (zoxide query $argv)
|
||||||
|
|
||||||
if test -d $result; and string length -q -- $result
|
if test -d $_zoxide_result; and string length -q -- $_zoxide_result
|
||||||
_z_cd $result
|
_z_cd $_zoxide_result
|
||||||
or return $status
|
or return $status
|
||||||
else if test -n "$result"
|
else if test -n "$_zoxide_result"
|
||||||
echo $result
|
echo $_zoxide_result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -37,12 +37,13 @@ _z_cd() {{
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
result="$(zoxide query "$@")" || return "$?"
|
_zoxide_result="$(zoxide query "$@")" || return "$?"
|
||||||
if [ -d "$result" ]; then
|
if [ -d "$_zoxide_result" ]; then
|
||||||
_z_cd "$result" || return "$?"
|
_z_cd "$_zoxide_result" || return "$?"
|
||||||
elif [ -n "$result" ]; then
|
elif [ -n "$_zoxide_result" ]; then
|
||||||
echo "$result"
|
echo "$_zoxide_result"
|
||||||
fi
|
fi
|
||||||
|
unset _zoxide_result
|
||||||
fi
|
fi
|
||||||
}}
|
}}
|
||||||
"#,
|
"#,
|
||||||
|
@ -31,11 +31,11 @@ function {} {{
|
|||||||
z_cd -
|
z_cd -
|
||||||
}}
|
}}
|
||||||
else {{
|
else {{
|
||||||
$result = zoxide query @args
|
$_zoxide_result = zoxide query @args
|
||||||
if ($LASTEXITCODE -eq 0 -and $result -is [string] -and (Test-Path $result)) {{
|
if ($LASTEXITCODE -eq 0 -and $_zoxide_result -is [string] -and (Test-Path $_zoxide_result)) {{
|
||||||
z_cd $result
|
z_cd $_zoxide_result
|
||||||
}} else {{
|
}} else {{
|
||||||
$result
|
$_zoxide_result
|
||||||
}}
|
}}
|
||||||
}}
|
}}
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user