feat: user gets asked to install neovim config either minimal or standard
This commit is contained in:
parent
76c71e8343
commit
bfc876d91c
1 changed files with 15 additions and 12 deletions
27
install.sh
27
install.sh
|
@ -31,7 +31,7 @@ command_exists() {
|
||||||
|
|
||||||
# ─< Check if the user is root and set sudo variable if necessary >───────────────────────
|
# ─< Check if the user is root and set sudo variable if necessary >───────────────────────
|
||||||
check_root() {
|
check_root() {
|
||||||
if (( EUID != 0 )); then
|
if ((EUID != 0)); then
|
||||||
if command_exists sudo; then
|
if command_exists sudo; then
|
||||||
echo_info "User is not root. Using sudo for privileged operations."
|
echo_info "User is not root. Using sudo for privileged operations."
|
||||||
_sudo="sudo"
|
_sudo="sudo"
|
||||||
|
@ -164,6 +164,11 @@ askThings() {
|
||||||
echo_info "Do you also want to install optional packages? (y/n)"
|
echo_info "Do you also want to install optional packages? (y/n)"
|
||||||
read -r askOptional </dev/tty
|
read -r askOptional </dev/tty
|
||||||
|
|
||||||
|
if [ ! -d "$HOME/.config/nvim" ]; then
|
||||||
|
echo_info "Do you also want to install a neovim config? [m]inimal || [s]tandard || [n]o"
|
||||||
|
read -r askNvim </dev/tty
|
||||||
|
fi
|
||||||
|
|
||||||
case "$askOptional" in
|
case "$askOptional" in
|
||||||
[yY]) __optional__="true" ;;
|
[yY]) __optional__="true" ;;
|
||||||
[nN]) __optional__="false" ;;
|
[nN]) __optional__="false" ;;
|
||||||
|
@ -172,11 +177,12 @@ askThings() {
|
||||||
|
|
||||||
cloneDots() {
|
cloneDots() {
|
||||||
choise="$1"
|
choise="$1"
|
||||||
|
cloneName="${2:-$1}"
|
||||||
|
|
||||||
if command_exists git; then
|
if command_exists git; then
|
||||||
[ -d ./dotfiles ] &&
|
[ -d ./dotfiles ] &&
|
||||||
[ ! -d "./dotfiles/${choise}" ] &&
|
[ ! -d "./dotfiles/${choise}" ] &&
|
||||||
git clone --depth=1 "https://git.k4li.de/dotfiles/${choise}.git" "./dotfiles/.config/${choise}"
|
git clone --depth=1 "https://git.k4li.de/dotfiles/${choise}.git" "./dotfiles/.config/${cloneName}"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo_error "Git was not found"
|
echo_error "Git was not found"
|
||||||
|
@ -207,20 +213,17 @@ __validate__() {
|
||||||
[kK] | kitty) cloneDots "kitty" ;;
|
[kK] | kitty) cloneDots "kitty" ;;
|
||||||
[aA] | alacritty) cloneDots "alacritty" ;;
|
[aA] | alacritty) cloneDots "alacritty" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
case "$askNvim" in
|
||||||
|
[mM] | minimal) cloneDots "nvim-mini" "nvim" ;;
|
||||||
|
[sS] | standard) cloneDots "nvim" ;;
|
||||||
|
[nN] | no) return 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
else
|
else
|
||||||
echo_error "Something went terribly wrong"
|
echo_error "Something went terribly wrong"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "$HOME/.config/nvim" ]; then
|
|
||||||
echo_note "There was no nvim config found, do you want to clone the pika nvim? (y/n)"
|
|
||||||
read -r _neovim </dev/tty
|
|
||||||
case "$_neovim" in
|
|
||||||
[yY])
|
|
||||||
git clone --recursive --depth=1 https://git.k4li.de/dotfiles/nvim.git "$HOME/.config/nvim"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__dep__() {
|
__dep__() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue