testing bash arrays..

This commit is contained in:
pika 2025-05-12 13:56:37 +02:00
parent 73cebe7bf5
commit 7a8fafdff7

View file

@ -51,12 +51,6 @@
[alpine]="depsAlpine" [alpine]="depsAlpine"
[opensuse]="depsOpensuse" [opensuse]="depsOpensuse"
) )
# declare -A deps
# deps[debian]="depsDebian"
# deps[fedora]="depsFedora"
# deps[opensuse]="depsOpensuse"
# deps[arch]="depsArch"
# deps[alpine]="depsAlpine"
declare -n pkgArray="${deps[$distro]}" declare -n pkgArray="${deps[$distro]}"
@ -70,8 +64,8 @@
} }
cloneSources() { cloneSources() {
local cloneDir="$(mktemp -d)" cloneDir="$(mktemp -d)"
echo_info "Cloning neovim sources into tempdir at $cloneDir" echo_info "Cloning neovim sources into tempdir at $cloneDir/neovim"
cd $cloneDir || mkdir $cloneDir && cd $cloneDir cd $cloneDir || mkdir $cloneDir && cd $cloneDir
if command_exists git; then if command_exists git; then
@ -84,6 +78,7 @@
echo_error "Git was required, but is missing.. exiting now" echo_error "Git was required, but is missing.. exiting now"
exit 1 exit 1
fi fi
} }
makeInstall() { makeInstall() {
@ -101,6 +96,24 @@
if [ -d "$HOME/.config/nvim/" ]; then if [ -d "$HOME/.config/nvim/" ]; then
echo_info "Prefetching neovim setup configuration.." echo_info "Prefetching neovim setup configuration.."
run nvim --headless +q run nvim --headless +q
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
case "$askNvim" in
[Yy])
git clone --recursive --depth=1 https://git.k4li.de/dotfiles/nvim.git "$HOME/.config/nvim"
sleep 0.2
run nvim --headless +q
;;
[Mm])
git clone --recursive --depth=1 https://git.k4li.de/dotfiles/nvim-mini.git "$HOME/.config/nvim"
sleep 0.2
run nvim --headless +q
;;
[Nn]) return 0 ;;
*) return 69 ;;
esac
fi fi
} }
@ -119,5 +132,9 @@
installBuildDependencies installBuildDependencies
cloneSources cloneSources
makeInstall makeInstall
echo_note "Cleaning up old $cloneDir directory.."
rm -rf "$cloneDir"
checkAndInitConfig checkAndInitConfig
} }