# pathprepend() {
#     if [[ ":$PATH:" != *":$1:"* ]]; then
#         PATH="$1${PATH:+":$PATH"}"
#     fi
# }

# pathprepend "$HOME/.local/bin"

# By "POSIX compliant" I mean without any bashism. This is what I have now in ~/.profile:

# shellcheck disable=SC2250
pathprepend() {
  case ":$PATH:" in
    *":$1:"*)
      :
      ;;
    *)
      PATH="$1${PATH:+":$PATH"}"
      ;;
  esac
}

pathprepend "$HOME/.local/bin"
