From 6f30ac188d687522f56b41ebafe7e49c322af038 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 13 Apr 2022 17:04:46 -0500 Subject: Add path_add_unsafe and change path munging --- profile/manpath.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'profile/manpath.sh') diff --git a/profile/manpath.sh b/profile/manpath.sh index def1963..944059c 100644 --- a/profile/manpath.sh +++ b/profile/manpath.sh @@ -1,9 +1,15 @@ -# $MANPATH shouldn't be too extra complicated (as opposed to $PATH), -# so I'm not going to include a whole other function. AT SOME POINT, -# I suppose I should generalize that function to set /any/ path-type -# variable, not just $PATH. +# See 00_functions.sh for `path_add_unsafe'. + +path_add_unsafe MANPATH \ + "${XDG_DATA_HOME:-$HOME/.local/share}/man" \ + "$HOME/.local/local/man" \ + "$HOME/usr/local/man" + # $MANPATH ends with `:' so that manpath(1) will prepend it to its # special thing. +case "$MANPATH" in + *:) ;; + *) MANPATH="$MANPATH:" ;; +esac -MANPATH="${XDG_DATA_HOME:-$HOME/.local/share}/man:" export MANPATH -- cgit 1.4.1-21-gabe81