-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_once_brew.sh.tmpl
48 lines (40 loc) · 1.11 KB
/
run_once_brew.sh.tmpl
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
#!/usr/bin/env -S bash -x
{{ if (eq .chezmoi.os "darwin") }}
if test ! $(which brew); then
printf '\e[33mHomebrew not found. \e[0mInstalling Homebrew...\n'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
else
printf 'Homebrew found. Continuing...\n'
fi
printf 'Installing Homebrew packages...\n'
brew bundle --no-lock --file=/dev/stdin <<EOF
brew "fd"
brew "fzf"
brew "gh"
brew "jq"
brew "trash"
brew "wget"
brew "git"
EOF
{{ else if (eq .chezmoi.os "linux") }}
printf 'Installing apt-get packages...\n'
sudo apt-get install -y \
fd-find \
fzf \
gh \
jq \
wget \
git
{{ end -}}
if [[ -z "${CODESPACE_VSCODE_FOLDER}" ]]; then
printf "Setting up commit-graph in ${CODESPACE_VSCODE_FOLDER}"
(cd $CODESPACE_VSCODE_FOLDER; git commit-graph write --reachable --changed-paths)
fi
# Set zsh as my default shell:
{{ if (eq .chezmoi.os "linux") }}
printf 'Setting zsh as shell'
if [[ -n "$(grep $(whoami) /etc/passwd)" ]] && ! grep -q "$(whoami).*/bin/zsh" /etc/passwd; then
sudo chsh -s /bin/zsh $(whoami)
fi
{{ end -}}