commit 2a31d2fe024ea6c93f863b23b1c2bca3ab3c8ab2
parent 9f043a0bb8609c940549939d0d20fe0c796fe74c
Author: Pontus Pihlgren <pontus.pihlgren@gmail.com>
Date: Fri, 21 Jul 2023 09:40:47 +0200
parent 9f043a0bb8609c940549939d0d20fe0c796fe74c
Author: Pontus Pihlgren <pontus.pihlgren@gmail.com>
Date: Fri, 21 Jul 2023 09:40:47 +0200
Add relative paths to reduce output width
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/git-summary b/git-summary @@ -84,6 +84,7 @@ git_summary() { # Use provided path, or default to pwd local target=$(${readlink_cmd} -f ${1:-`pwd`}) + target=$(${realpath_cmd} $target) local repos=$(list_repos $target $deeplookup) if [[ -z $repos ]]; then @@ -129,28 +130,33 @@ detect_OS() { if [ "$(uname)" == "Darwin" ]; then # macOS OS=Darwin readlink_cmd="greadlink" + realpath_cmd="echo" # TODO implement me to avoid absolute paths dirname_cmd="gdirname" gawk_cmd="awk" elif [ "$(uname)" == "SunOS" ]; then # SunOS (solaris/smartos/illumos) OS=SunOS readlink_cmd="greadlink" + realpath_cmd="echo" # TODO implement me to avoid absolute paths dirname_cmd="gdirname" gawk_cmd="awk" elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then # Linux-based system if [[ $(cat /proc/version) == *"Chromium OS"* ]]; then # Chromium OS OS=Linux readlink_cmd="readlink" + realpath_cmd="realpath --relative-to=`pwd`" dirname_cmd="dirname_zero" gawk_cmd="gawk" else # Vanilla Linux OS=Linux readlink_cmd="readlink" + realpath_cmd="realpath --relative-to=`pwd`" dirname_cmd="dirname" gawk_cmd="gawk" fi elif [ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ]; then # Cygwin OS=CYGWIN readlink_cmd="readlink" + realpath_cmd="realpath --relative-to=`pwd`" dirname_cmd="dirname" gawk_cmd="gawk" else
: nply/git-summary