config-bash/libs/path.bash

10 lines
224 B
Bash
Raw Normal View History

2024-01-27 19:04:33 +01:00
#!/bin/bash
_path_add() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="${PATH:+"$PATH:"}$1"
fi
}
# Source : https://superuser.com/questions/39751/add-directory-to-path-if-its-not-already-there