mirror of
https://github.com/Ascyii/scripts.git
synced 2026-01-01 04:44:24 -05:00
9 lines
220 B
Bash
Executable File
9 lines
220 B
Bash
Executable File
function y() {
|
|
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
|
|
yazi "$@" --cwd-file="$tmp"
|
|
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
|
builtin cd -- "$cwd"
|
|
fi
|
|
rm -f -- "$tmp"
|
|
}
|