-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.path
113 lines (95 loc) · 3.88 KB
/
.path
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env bash
# COMMON CONFIGURATION
# ====================
# Bun (see https://bun.sh/)
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# Jetbrains toolbox - shell scripts path
export PATH="$HOME/bin:$PATH"
# Pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
# local bin use by python pip installs
export PATH="$HOME/.local/bin:$PATH"
# tmuxifier for session layouts (installed via TPM in .tmux.conf) see $HOME/.tmux/plugins
export PATH="$HOME/.tmux/plugins/tmuxifier/bin:$PATH"
# OS SPECIFIC CONFIGURATION
# =========================
# Enhance bash-completion if completion is available
function enhance_bash_completion() {
if [[ -r "${HOME}/.git-completion" ]]; then
source "${HOME}/.git-completion"
verbLog 2 ".git-completion is available and has been sourced. Remember to sync_git_completion on git updates."
else
printf "⚠️ %s\n" "expected .git-completion is NOT available."
fi
if [[ -r "${HOME}/.git-flow-completion" ]]; then
source "${HOME}/.git-flow-completion"
verbLog 2 ".git-flow-completion is available and has been sourced."
else
printf "⚠️ %s\n" "expected .git-flow-completion is NOT available."
fi
}
# Darwin (macOS)-specific items
if [[ "$(uname)" == "Darwin" ]]; then
architecture=$(sysctl -n machdep.cpu.brand_string)
# edgedb-cli
export PATH="$HOME/Library/Application Support/edgedb/bin:$PATH"
# Check for Intel iMac
if [[ "$architecture" == *"Apple"* ]]; then
# Homebrew
HOMEBREW_PREFIX="/opt/homebrew"
BASH_HOMEBREW_HOME="${HOMEBREW_PREFIX}/bin"
if ! [[ "$PATH" =~ (^|:)"$BASH_HOMEBREW_HOME"(:|$) ]]; then
export PATH="$BASH_HOMEBREW_HOME:$PATH"
fi
# Establish bash-completion
# shellcheck disable=SC1091
if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
enhance_bash_completion
else
printf "⚠️ %s\n" "Warning: bash-completion not found in expected Homebrew Apple Silicon location."
fi
# Check for Apple Silicon
elif [[ "$architecture" == "Intel"* ]]; then
# Homebrew
HOMEBREW_PREFIX="/usr/local"
BASH_HOMEBREW_HOME="${HOMEBREW_PREFIX}/bin"
if ! [[ "$PATH" =~ (^|:)"$BASH_HOMEBREW_HOME"(:|$) ]]; then
export PATH="$BASH_HOMEBREW_HOME:$PATH"
fi
# Establish bash-completion
# shellcheck disable=SC1091
if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
enhance_bash_completion
else
printf "⚠️ %s\n" "Warning: bash-completion not found in expected Homebrew location on Intel macOS location."
fi
fi
# Java OpenJDK
# for running google closure compiler from jar file (brew caveats as apple
# installs similar files so take care of install instructions)
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
export CPPFLAGS="-I/opt/homebrew/opt/openjdk/include"
# MIT Scheme
export PATH="$PATH:$HOME/projects/mit-scheme-12.1/src/mit-scheme.app/Contents/Resources"
fi
# Fedora Linux-specific items
# Detecting Feora on Apple Silicon via Asahi Linux
# TODO: make sure no changes needed for adding git-flow and bash-completion
if [[ "$(uname)" == "Linux" ]]; then
# Establish bash-completion
# shellcheck disable=SC1091
if [[ -r "/usr/share/bash-completion/bash_completion" ]]; then
# Fedora default location
source "/usr/share/bash-completion/bash_completion"
enhance_bash_completion
else
printf "⚠️ %s\n" "Warning: bash-completion not found in expected Linux location."
fi
fi