-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zprofile.tmpl
More file actions
27 lines (27 loc) · 949 Bytes
/
dot_zprofile.tmpl
File metadata and controls
27 lines (27 loc) · 949 Bytes
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
{{- if eq .chezmoi.os "darwin" }}
# Homebrew environment for login shells (cached for speed)
_brew_cache="${XDG_CACHE_HOME:-$HOME/.cache}/brew-shellenv.zsh"
{{- if eq .chezmoi.arch "arm64" }}
_brew_bin="/opt/homebrew/bin/brew"
{{- else }}
_brew_bin="/usr/local/bin/brew"
{{- end }}
if [ -x "$_brew_bin" ]; then
if [ ! -f "$_brew_cache" ] || [ "$_brew_bin" -nt "$_brew_cache" ]; then
"$_brew_bin" shellenv > "$_brew_cache" 2>/dev/null
fi
. "$_brew_cache"
fi
unset _brew_cache _brew_bin
{{- else if eq .chezmoi.os "linux" }}
# Linuxbrew (if installed, cached for speed)
if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then
_brew_cache="${XDG_CACHE_HOME:-$HOME/.cache}/brew-shellenv.zsh"
_brew_bin="/home/linuxbrew/.linuxbrew/bin/brew"
if [ ! -f "$_brew_cache" ] || [ "$_brew_bin" -nt "$_brew_cache" ]; then
"$_brew_bin" shellenv > "$_brew_cache" 2>/dev/null
fi
. "$_brew_cache"
unset _brew_cache _brew_bin
fi
{{- end }}