This repository has been archived on 2020-09-21. You can view files and clone it, but cannot push or open issues or pull requests.
zim/modules/fasd/functions/fasd_cd
Matt Hamilton 03f15c4495 [fasd] add initial fasd support
[zlogin] zcompare fasd and all functions

[fasd] trim non-zsh options

[fasd] merge PR #75 from clvv/fasd

[fasd] partial merge PR #77 from clvv/fasd

This closes #24
2016-03-27 18:45:05 -04:00

9 lines
227 B
Plaintext

# 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