testing beautiful script

This commit is contained in:
pika 2025-05-21 19:25:04 +02:00
parent f2b3b09507
commit 79876e23fd

View file

@ -31,7 +31,9 @@
source "$import"
sleep 0.3
rm "$import"
echo_warning "cleaned $import"
source
# echo_warning "cleaned $import"
source-script "https://git.k4li.de/scripts/beddu/raw/branch/main/dist/beddu.sh"
}
getDependencies() {
@ -67,13 +69,15 @@
cloneSources() {
cloneDir="$(mktemp -d)"
echo_pkg git "Cloning $PACKAGE sources at $cloneDir/neovim.."
# echo_pkg git "Cloning $PACKAGE sources at $cloneDir/neovim.."
cd $cloneDir || mkdir $cloneDir && cd $cloneDir
if command_exists git; then
spin yellow "Cloning $PACKAGE sources at $cloneDir/neovim.."
if run git clone --depth=1 https://github.com/neovim/neovim.git; then
cd neovim || echo_error "Cannot navigate into neovim"
check "Cloned sources"
else
echo_error "Cannot clone the repo.."
fi
@ -85,7 +89,8 @@
}
makeInstall() {
echo_pkg build "Compiling neovim from source"
# echo_pkg build "Compiling neovim from source"
spin "Compiling neovim from source"
if run make CMAKE_BUILD_TYPE=RelWithDebInfo; then
echo_pkg install
run $_sudo make install
@ -97,25 +102,32 @@
checkAndInitConfig() {
if [ -d "$HOME/.config/nvim/" ]; then
echo_pkg qol "Prefetching neovim setup configuration.."
nvim --headless +q
# echo_pkg qol "Prefetching neovim setup configuration.."
spin "Prefetching neovim setup configuration.."
if nvim --headless +q; then
check "Prefetched config"
fi
else
echo_warning "You don't have a neovim config installed. Do you want to clone one now? [Y]es (standard), [m]inimal, [n]o"
read -r askNvim
# echo_warning "You don't have a neovim config installed. Do you want to clone one now? [Y]es (standard), [m]inimal, [n]o"
# read -r askNvim
choose askNvim "You don't have a neovim config installed. Do you want to clone one now?" "pika's standard config" "pika's minimal config" none
case "$askNvim" in
[Yy])
"pika's standard config")
git clone --recursive --depth=1 https://git.k4li.de/dotfiles/nvim.git "$HOME/.config/nvim"
sleep 0.2
nvim --headless +q
;;
[Mm])
"pika's minimal config")
git clone --recursive --depth=1 https://git.k4li.de/dotfiles/nvim-mini.git "$HOME/.config/nvim"
sleep 0.2
nvim --headless +q
;;
[Nn]) return 0 ;;
*) return 69 ;;
none) return 0 ;;
*)
echo_error "Something failed HARD!"
return 69
;;
esac
fi
}