fix: Fix PROMPT_COMMAND management
This commit is contained in:
1 parent
fe6642402b
commit
66c57a0a51
3 files changed
+19
-1
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user