bash_aliases: cs: only cd to dirname of argument if argument exists in filesystem

This commit is contained in:
Josh Holtrop 2014-03-12 13:43:34 -04:00
parent 206a087d54
commit 034e52399b

View File

@ -271,9 +271,13 @@ if [[ -e /bin/cygwin1.dll ]]; then
{ {
while [[ "$1" != "" ]] while [[ "$1" != "" ]]
do do
dn=$(dirname "$1") if [[ -e "$1" ]]; then
bn=$(basename "$1") dn=$(dirname "$1")
(cd "$dn"; HOME='' cygstart "$bn") bn=$(basename "$1")
(cd "$dn"; HOME='' cygstart "$bn")
else
HOME='' cygstart "$1"
fi
shift shift
done done
} }