1
0
chezmoi/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl

83 lines
1.7 KiB
Cheetah
Raw Normal View History

2024-01-20 21:50:27 +00:00
#!/usr/bin/env bash
2024-03-01 10:26:26 +00:00
# Logging function
log() {
2024-03-01 10:47:05 +00:00
printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1"
}
inf() {
printf "$(tput setaf 2)$(tput sgr 0 1)%s$(tput sgr0)\n" "$1"
2024-03-01 10:26:26 +00:00
}
2024-02-28 20:38:45 +00:00
2024-03-01 10:26:26 +00:00
# Packages to install
2024-02-28 20:38:45 +00:00
packages=(
cargo
go
neovim
npm
python-pip
python-pynvim
ripgrep
)
2024-03-01 10:26:26 +00:00
log ">>>>> Begin LVim installation <<<<<"
2024-01-20 21:55:48 +00:00
2024-02-26 22:12:51 +00:00
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
2024-01-20 21:50:27 +00:00
2024-02-28 20:38:45 +00:00
## Update system
2024-03-01 10:47:05 +00:00
inf "updating system..."
2024-02-28 20:38:45 +00:00
yay -Syu --noconfirm
2024-02-26 22:12:51 +00:00
## Install packages
2024-02-28 20:38:45 +00:00
for package in ${packages[@]}; do
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
2024-03-01 10:47:05 +00:00
inf "installing ${package}..."
2024-02-28 20:38:45 +00:00
yay -S --noconfirm $package
fi
done
2024-02-26 22:12:51 +00:00
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
2024-02-28 20:38:45 +00:00
DEBIAN_FRONTEND=noninteractive
## Update system
2024-03-01 10:47:05 +00:00
inf "updating system..."
2024-02-28 20:38:45 +00:00
{{- if ne .chezmoi.username "root" }}
sudo -E apt update
sudo -E apt upgrade --yes
{{- else }}
apt update
apt upgrade --yes
{{- end}}
2024-02-27 15:39:55 +00:00
2024-02-26 22:12:51 +00:00
## Install packages
2024-02-28 20:38:45 +00:00
packages=(${packages[@]//go/golang})
packages=(${packages[@]//python/python3})
packages=(${packages[@]//neovim/})
for package in ${packages[@]}; do
2024-03-01 10:47:05 +00:00
inf "installing ${package}..."
2024-02-28 20:38:45 +00:00
2024-02-27 15:18:56 +00:00
{{- if ne .chezmoi.username "root" }}
2024-02-28 20:38:45 +00:00
sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package
{{- else }}
apt-get install --yes --no-install-recommends --ignore-missing $package
2024-02-27 15:18:56 +00:00
{{- end }}
2024-02-28 20:38:45 +00:00
done
2024-02-26 22:12:51 +00:00
2024-03-01 10:47:05 +00:00
inf "installing neovim..."
2024-02-28 20:38:45 +00:00
mist install neovim
2024-02-27 14:06:11 +00:00
2024-02-26 22:12:51 +00:00
{{- end }}
2024-01-06 22:09:43 +00:00
2024-03-01 10:47:05 +00:00
inf "installing lvim..."
LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s 'https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh')
2024-01-20 21:55:48 +00:00
2024-03-01 10:26:26 +00:00
log ">>>>> Finish LVim installation <<<<<"
2024-02-28 20:38:45 +00:00