-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
36 lines (30 loc) · 1.87 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
#!/usr/bin/env bash
# shellcheck source=/dev/null disable=SC1090
export BASH_SILENCE_DEPRECATION_WARNING=1
test -f /opt/homebrew/bin/brew && eval "$(/opt/homebrew/bin/brew shellenv)"
test -f /usr/local/bin/brew && eval "$(/usr/local/bin/brew shellenv)"
[[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && source "$(brew --prefix)/etc/profile.d/bash_completion.sh"
# set -a; source "/Users/marslo/.marslo/.marslorc"; set +a; # `-a`: mark variables which are modified or created for export
# set -x; source "/Users/marslo/.marslo/.marslorc"; set +x; # `-x`: print commands and their arguments as they are executed
# bash -ixlc : 2>&1 | grep ... # debug bash full start process : https://unix.stackexchange.com/a/322468/29178
! test -f "$HOME/.marslo/.marslorc" || source "$HOME/.marslo/.marslorc"
# remove empty line:
# - sed '/^$/d'
# - awk 'NF > 0' or awk 'NF'
# remove duplicate line:
# - awk '!x[$0]++'
# - https://stackoverflow.com/a/11532197/2940319
# shellcheck disable=SC2155
if [[ 'Darwin' = "$(uname)" ]]; then
test -f "$(brew --prefix coreutils)/libexec/gnubin/paste" &&
export PATH=$( echo "${PATH}" | tr ':' '\n' | awk 'NF' | awk '!x[$0]++' | "$(brew --prefix coreutils)/libexec/gnubin/paste" -s -d: )
# shellcheck disable=SC2015
command -v brew >/dev/null && source "$(brew --prefix git)"/etc/bash_completion.d/git-*.sh \
|| source "$(brew --prefix git)"/etc/bash_completion.d/git-prompt.sh
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
else
command -v paste >/dev/null &&
export PATH=$( echo "$PATH" | tr ':' '\n' | awk 'NF' | awk '!x[$0]++' | paste -s -d: )
fi
! test -d "$HOME"/perl5 || eval "$(perl -I"$HOME"/perl5/lib/perl5 -Mlocal::lib="$HOME"/perl5)"
# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:filetype=sh