mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Use explorer.exe as file manager if available
This commit is contained in:
parent
06e082c918
commit
b4a5fa9615
@ -96,6 +96,9 @@ jo() {
|
|||||||
|
|
||||||
output="$(autojump ${@})"
|
output="$(autojump ${@})"
|
||||||
if [[ -d "${output}" ]]; then
|
if [[ -d "${output}" ]]; then
|
||||||
|
if command -v explorer.exe >/dev/null 2>&1; then
|
||||||
|
explorer.exe "${output}"
|
||||||
|
else
|
||||||
case ${OSTYPE} in
|
case ${OSTYPE} in
|
||||||
linux*)
|
linux*)
|
||||||
xdg-open "${output}"
|
xdg-open "${output}"
|
||||||
@ -110,6 +113,7 @@ jo() {
|
|||||||
echo "Unknown operating system: ${OSTYPE}." 1>&2
|
echo "Unknown operating system: ${OSTYPE}." 1>&2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "autojump: directory '${@}' not found"
|
echo "autojump: directory '${@}' not found"
|
||||||
echo "\n${output}\n"
|
echo "\n${output}\n"
|
||||||
|
@ -83,6 +83,9 @@ end
|
|||||||
function jo
|
function jo
|
||||||
set -l output (autojump $argv)
|
set -l output (autojump $argv)
|
||||||
if test -d "$output"
|
if test -d "$output"
|
||||||
|
if command --search explorer.exe >/dev/null 2>&1 do
|
||||||
|
explorer.exe (autojump $argv)
|
||||||
|
else
|
||||||
switch $OSTYPE
|
switch $OSTYPE
|
||||||
case 'linux*'
|
case 'linux*'
|
||||||
xdg-open (autojump $argv)
|
xdg-open (autojump $argv)
|
||||||
@ -93,6 +96,7 @@ function jo
|
|||||||
case '*'
|
case '*'
|
||||||
__aj_err "Unknown operating system: \"$OSTYPE\""
|
__aj_err "Unknown operating system: \"$OSTYPE\""
|
||||||
end
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
__aj_err "autojump: directory '"$argv"' not found"
|
__aj_err "autojump: directory '"$argv"' not found"
|
||||||
__aj_err "\n$output\n"
|
__aj_err "\n$output\n"
|
||||||
|
@ -91,6 +91,9 @@ jo() {
|
|||||||
setopt localoptions noautonamedirs
|
setopt localoptions noautonamedirs
|
||||||
local output="$(autojump ${@})"
|
local output="$(autojump ${@})"
|
||||||
if [[ -d "${output}" ]]; then
|
if [[ -d "${output}" ]]; then
|
||||||
|
if command -v explorer.exe >/dev/null 2>&1; then
|
||||||
|
explorer.exe "${output}"
|
||||||
|
else
|
||||||
case ${OSTYPE} in
|
case ${OSTYPE} in
|
||||||
linux*)
|
linux*)
|
||||||
xdg-open "${output}"
|
xdg-open "${output}"
|
||||||
@ -105,6 +108,7 @@ jo() {
|
|||||||
echo "Unknown operating system: ${OSTYPE}" 1>&2
|
echo "Unknown operating system: ${OSTYPE}" 1>&2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "autojump: directory '${@}' not found"
|
echo "autojump: directory '${@}' not found"
|
||||||
echo "\n${output}\n"
|
echo "\n${output}\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user