.lib/sh/path.bash

Fri, 06 Jan 2023 12:12:04 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 06 Jan 2023 12:12:04 -0600
changeset 1008
57b5c867f2a6
parent 968
0db164e368c5
permissions
-rw-r--r--

add ri alias

path-append() {
  if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
    PATH="${PATH:+"$PATH:"}$1"
    return 0
  fi
  return 1
}

path-prepend() {
  if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
    PATH="$1${PATH:+":$PATH"}"
    return 0
  fi
  return 1
}

mercurial