fix: Fix PROMPT_COMMAND management

This commit is contained in:
2024-01-27 19:04:33 +01:00
parent fe6642402b
commit 66c57a0a51
3 changed files with 19 additions and 1 deletions

9
libs/path.bash Normal file
View File

@ -0,0 +1,9 @@
#!/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

9
libs/prompt_command.bash Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
_prompt_command_add() {
if [ -n "$1" ] && [[ ":$PROMPT_COMMAND:" != *":$1:"* ]]; then
PROMPT_COMMAND="${PROMPT_COMMAND:+"$PROMPT_COMMAND:"}$1"
fi
}
export PROMPT_COMMAND