aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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