forked from alrra/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash_profile
70 lines (46 loc) · 1.94 KB
/
bash_profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
# Q pre block. Keep at the top of this file.
[[ -f "${HOME}/Library/Application Support/amazon-q/shell/bash_profile.pre.bash" ]] && builtin source "${HOME}/Library/Application Support/amazon-q/shell/bash_profile.pre.bash"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
source_bash_files() {
declare -r CURRENT_DIRECTORY="$(pwd)"
declare -r -a FILES_TO_SOURCE=(
"bash_init"
"bash_aliases"
"bash_autocomplete"
"bash_bash-it"
"bash_direnv"
"bash_exports"
"bash_functions"
"bash_options"
"bash_prompt"
"bash_zoxide"
"bash.local" # For local settings that should
# not be under version control.
)
local file=""
local i=""
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cd "$(dirname "$(readlink "${BASH_SOURCE[0]}")")" \
&& . "../os/utils.sh"
# shellcheck disable=SC2034
declare -r OS="$(get_os)"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
for i in ${!FILES_TO_SOURCE[*]}; do
file="$HOME/.${FILES_TO_SOURCE[$i]}"
# -r : True if file exists and is readable.
[ -r "$file" ] \
&& . "$file"
done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cd "$CURRENT_DIRECTORY"
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
source_bash_files
unset -f source_bash_files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Clear system messages (system copyright notice, the date
# and time of the last login, the message of the day, etc.).
if test -z "$TMUX"; then eval clear; fi
# Q post block. Keep at the bottom of this file.
[[ -f "${HOME}/Library/Application Support/amazon-q/shell/bash_profile.post.bash" ]] && builtin source "${HOME}/Library/Application Support/amazon-q/shell/bash_profile.post.bash"