about summary refs log tree commit diff stats
path: root/home-manager/packages/scripts/deprecated/csd
blob: 33105314d52bbb2470fa1e43575a943c966d27c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#! /bin/zsh
function cd () {
    if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then
        [[ ! -e ${1:h} ]] && return 1
        print "Correcting ${1} to ${1:h}"
        builtin cd ${1:h}
    else
        builtin cd "$@"
    fi
}