diff options
| author | kj-sh604 | 2024-07-17 22:37:16 -0400 |
|---|---|---|
| committer | kj-sh604 | 2024-07-17 22:37:16 -0400 |
| commit | 70532272be7010f2480f39cf0b9e2038b8cdfef7 (patch) | |
| tree | d721652d77a7e53efe16c8088b84c90c6dd104c7 /.config/shell/.bashrc | |
| parent | fe0f355277b220f304b2e58695349add20741e91 (diff) | |
refactor: improve readability
Diffstat (limited to '.config/shell/.bashrc')
| -rw-r--r-- | .config/shell/.bashrc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/.config/shell/.bashrc b/.config/shell/.bashrc index 286afd9..8782090 100644 --- a/.config/shell/.bashrc +++ b/.config/shell/.bashrc @@ -1,6 +1,21 @@ # note: this file needs to be sourced in /etc/bash.bashrc -. ~/.config/shell/git-prompt.sh +# personal QOL functions +source_if_exists() { + [ -f "$1" ] && source "$1" +} + +ensure_directory_and_file() { + [ ! -d "$1" ] && mkdir -p "$1" + [ ! -f "$2" ] && touch "$2" +} + +# Source personal POSIX functions +source_if_exists ~/.config/shell/posix-functions/create_POSIX_dotenv.sh +source_if_exists ~/.config/shell/posix-functions/POSIX_open.sh + +# git prompt +source_if_exists ~/.config/shell/git-prompt.sh export GIT_PS1_SHOWDIRTYSTATE=1 if [[ $- != *i* ]] ; then @@ -71,17 +86,4 @@ done unset use_color sh -source_if_exists() { - [ -f "$1" ] && source "$1" -} - -ensure_directory_and_file() { - [ ! -d "$1" ] && mkdir -p "$1" - [ ! -f "$2" ] && touch "$2" -} - -# Source personal POSIX functions -source_if_exists ~/.config/shell/posix-functions/create_POSIX_dotenv.sh -source_if_exists ~/.config/shell/posix-functions/POSIX_open.sh - export HISTFILE="$XDG_STATE_HOME"/shell/history |
