.lib/sh/path.bash

Wed, 25 Sep 2024 15:03:13 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 25 Sep 2024 15:03:13 -0500
changeset 1179
b0a0ba3240b5
parent 968
0db164e368c5
permissions
-rw-r--r--

No LSP autostart when read-only

I think nvim actually threw out 'view' argc detection, I just use -R and alias
view to it.

270
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 path-append() {
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 PATH="${PATH:+"$PATH:"}$1"
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 return 0
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 fi
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 return 1
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 }
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 path-prepend() {
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 PATH="$1${PATH:+":$PATH"}"
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 return 0
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 fi
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 return 1
dda2a7f4d485 nice up bashrc and xsessionrc
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 }

mercurial