1
0
Fork 0
mirror of synced 2024-12-27 08:23:21 -05:00
zimfw/modules/fasd/functions/fasd_cd

9 lines
227 B
Text
Raw Normal View History

# function to execute built-in cd
if [ $# -le 1 ]; then
fasd "$@"
else
local _fasd_ret="$(fasd -e 'printf %s' "$@")"
[ -z "$_fasd_ret" ] && return 1
[ -d "$_fasd_ret" ] && cd "$_fasd_ret" || printf %s\n "$_fasd_ret"
fi