aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2015-07-02 10:01:13 +0200
committerDuncaen <mail@duncano.de>2015-07-02 10:01:13 +0200
commit1c3801d82c17788cc5d03f8ba28f39616b25e263 (patch)
treeced14d14bf13129f91d40295ee36caed15f1c4ef
parentd60a9e37b960073911d4e1ede61c683175b59f4a (diff)
downloaddotfiles-1c3801d82c17788cc5d03f8ba28f39616b25e263.tar.gz
add bin/h
-rwxr-xr-xbin/h8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/h b/bin/h
new file mode 100755
index 0000000..4cb900d
--- /dev/null
+++ b/bin/h
@@ -0,0 +1,8 @@
+#!/bin/mksh
+
+dir="$PWD"
+while [ -n "$dir" ]; do
+ [ -d "$dir/.git" ] && break
+ [ "$dir" = "$HOME" ] && break
+ dir="${dir%/*}"
+done && echo "$dir" || return 1