From 7e60f13d7da64060b520408ff99bc593d91effa3 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 21 May 2012 16:24:39 -0400 Subject: [PATCH] Add spacing to increase readability --- modules/git/functions/git-root | 1 + modules/utility/functions/duh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/modules/git/functions/git-root b/modules/git/functions/git-root index d704eff..c5aa48f 100644 --- a/modules/git/functions/git-root +++ b/modules/git/functions/git-root @@ -6,6 +6,7 @@ # local root="$(git rev-parse --show-toplevel 2> /dev/null)" + if [[ -n "$root" ]]; then print "$root" return 0 diff --git a/modules/utility/functions/duh b/modules/utility/functions/duh index 896ed19..58ddc56 100644 --- a/modules/utility/functions/duh +++ b/modules/utility/functions/duh @@ -8,11 +8,13 @@ function duh { (( $# == 0 )) && set -- * + if grep -q -i 'GNU' < <(du --version 2>&1); then du -khsc "$@" | sort -h -r else local line size name local -a record + while IFS=$'\n' read line; do record=(${(z)line}) size="$(($record[1] / 1024.0))"