dotfiles

configuration files
git clone https://pi.duncano.de/git/dotfiles.git
Log | Files | Refs | README

commit 28bb440e6c5b056970b4948e252f9085e28015bb
parent 297e98d72661b0f895dfc65342cfed3ff780a183
Author: Duncaen <mail@duncano.de>
Date:   Mon, 13 Feb 2017 01:51:41 +0100

bin/h: add desc, cvs support and simplify

Diffstat:
bin/h | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/bin/h b/bin/h @@ -1,8 +1,10 @@ #!/bin/sh +# h - print the current paths vcs root or home -dir="$PWD" -while [ -n "$dir" ]; do - [ -d "$dir/.git" ] && break - [ "$dir" = "$HOME" ] && break - dir="${dir%/*}" -done && echo "$dir" || return 1 +while \ + [ -n "${d:=$PWD}" ] && \ + [ ! -d "$d/.git" ] && \ + [ ! -d "$d/CVSROOT" ] && \ + [ "$d" != "$HOME" ] + do d="${d%/*}" +done && printf "%s\n" "$d"