summaryrefslogtreecommitdiff
path: root/etc/functions/xhashd
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-03-26 14:37:15 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-03-26 14:37:15 +0100
commitcd81d62524d307ed451d3fc20d44dae2d8b46d01 (patch)
treedbe05e760023c1a6f3c9d1035426ca725b64860b /etc/functions/xhashd
parent856ac1585fc64ad29feb73a382659ca76dfab5c3 (diff)
use xhashd to only hash directories if they exist
Diffstat (limited to 'etc/functions/xhashd')
-rwxr-xr-xetc/functions/xhashd7
1 files changed, 7 insertions, 0 deletions
diff --git a/etc/functions/xhashd b/etc/functions/xhashd
new file mode 100755
index 0000000..2909ea7
--- /dev/null
+++ b/etc/functions/xhashd
@@ -0,0 +1,7 @@
+## vim:ft=zsh
+## hash a directory if it exists
+typeset directory=${~1#*\=} name=${1%%\=*}
+
+if [[ -d $directory ]] {
+ hash -d $name=$directory
+}