1
0
chezmoi/home/.chezmoiscripts/run_onchange_80-install-lvim.sh.tmpl
2024-02-27 10:15:13 +01:00

62 lines
1.7 KiB
Bash

#!/usr/bin/env bash
set -euxo pipefail
packages=(
neovim
python-pynvim
npm
)
echo -e "\033[0;32m>>>>> Begin LVim installation <<<<<\033[0m"
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
{{- /* we're on Arch based system */ -}}
## Update system
{{- if ne .chezmoi.username "root" }}
sudo pacman -Syu --noconfirm
{{- else }}
pacman -Syu --noconfirm
{{- end}}
## Install packages
for package in ${packages[@]}; do
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
echo "installing packages"
{{- if ne .chezmoi.username "root" }}
sudo yay -S --noconfirm $package
{{- else }}
yay -S --noconfirm $package
{{- end }}
fi
done
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
{{- /* we're on Debian based system */ -}}
echo -e "\033[0;32m>>>>> Begin zsh installation <<<<<\033[0m"
## Update system
{{- if ne .chezmoi.username "root" }}
DEBIAN_FRONTEND=noninteractive sudo -E apt update
DEBIAN_FRONTEND=noninteractive sudo -E apt upgrade --yes
{{- else }}
DEBIAN_FRONTEND=noninteractive apt update
DEBIAN_FRONTEND=noninteractive apt upgrade --yes
{{- end}}
## Install packages
{{- if ne .chezmoi.username "root" }}
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install --yes --no-install-recommends --ignore-missing python3-pynvim npm
{{- else }}
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends --ignore-missing python3-pynvim npm
{{- end }}
{{- end }}
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')
echo -e "\033[0;32m>>>>> Finish LVim installation <<<<<\033[0m"