1
0
chezmoi/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl
2024-03-01 11:26:26 +01:00

82 lines
1.6 KiB
Bash

#!/usr/bin/env bash
# Logging function
log() {
printf "${C_BLU}>>>>> %s <<<<<${F_RST}" "$1"
}
# Testing existance function
exist() {
command -v "$1$" >/dev/null 2>&1
}
# Packages to install
packages=(
cargo
go
neovim
npm
python-pip
python-pynvim
ripgrep
)
log ">>>>> Begin LVim installation <<<<<"
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
## Update system
yay -Syu --noconfirm
## Install packages
for package in ${packages[@]}; do
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
log "installing ${package}..."
yay -S --noconfirm $package
fi
done
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
DEBIAN_FRONTEND=noninteractive
## Update system
{{- if ne .chezmoi.username "root" }}
sudo -E apt update
sudo -E apt upgrade --yes
{{- else }}
apt update
apt upgrade --yes
{{- end}}
## Install packages
packages=(${packages[@]//go/golang})
packages=(${packages[@]//python/python3})
packages=(${packages[@]//neovim/})
for package in ${packages[@]}; do
log "installing ${package}..."
{{- if ne .chezmoi.username "root" }}
sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package
{{- else }}
apt-get install --yes --no-install-recommends --ignore-missing $package
{{- end }}
done
log "installing neovim..."
mist install neovim
{{- end }}
log "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')
log ">>>>> Finish LVim installation <<<<<"