generated from chezmoi/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_once_install-packages.sh.tmpl
40 lines (32 loc) · 1.33 KB
/
run_once_install-packages.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
{{ if eq .chezmoi.os "linux" -}}
#!/bin/sh
{{ if eq .chezmoi.osRelease.id "ubuntu" }}
sudo apt -y install zsh curl git
{{ end -}}
{{ if eq .chezmoi.osRelease.id "debian" }}
sudo apt -y install zsh curl git
{{ end -}}
{{- if eq .chezmoi.osRelease.id "arch" }}
sudo pacman -S --noconfirm zsh zsh-completions curl git
{{ end -}}
sudo chsh -s $(which zsh)
if [ ! -d ~/.oh-my-zsh ]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Oh My Zsh makes a backup, not necessary for this script.
rm -rf .zshrc .shell.pre-oh-my-zsh
mv .zshrc.pre-oh-my-zsh .zshrc
fi
# Enable zsh autosuggestions and completions
if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ]; then
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
fi
if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ]; then
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
fi
if [ ! -d ~/.oh-my-bash ]; then
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
# Need to restore bashrc file from chezmoi
# rm -rf .bashrc
# mv .bashrc.... .bashrc
fi
{{ end -}}