change packagename to neovim

This commit is contained in:
2025-09-24 00:10:29 +02:00
parent 08d68ecfde
commit 2f2e2a19e0
2 changed files with 11 additions and 8 deletions

19
scripts/image-builder.sh Normal file → Executable file
View File

@@ -64,18 +64,21 @@ install_docker_and_buildx() {
} }
set_editor() { set_editor() {
local editors=("nano" "vim" "micro" "neovim") # editor -> paketname
declare -A editor_pkg
editor_pkg=( ["nano"]="nano" ["vim"]="vim" ["micro"]="micro" ["nvim"]="neovim" )
local options=() local options=()
declare -A editor_status declare -A editor_status
# Prüfe, ob Editor installiert ist # Prüfe, ob Editor installiert ist
for e in "${editors[@]}"; do for cmd in "${!editor_pkg[@]}"; do
if command -v "$e" >/dev/null 2>&1; then if command -v "$cmd" >/dev/null 2>&1; then
editor_status[$e]="(installiert)" editor_status[$cmd]="(installiert)"
else else
editor_status[$e]="(nicht installiert)" editor_status[$cmd]="(nicht installiert)"
fi fi
options+=("$e" "${editor_status[$e]}") options+=("$cmd" "${editor_status[$cmd]}")
done done
while true; do while true; do
@@ -89,9 +92,9 @@ set_editor() {
install_choice=$(whiptail --title "Editor nicht installiert" \ install_choice=$(whiptail --title "Editor nicht installiert" \
--yesno "Der Editor '$choice' ist nicht installiert. Möchten Sie ihn jetzt installieren?" 10 60 3>&1 1>&2 2>&3) --yesno "Der Editor '$choice' ist nicht installiert. Möchten Sie ihn jetzt installieren?" 10 60 3>&1 1>&2 2>&3)
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
whiptail --msgbox "Installation von $choice..." 8 50 whiptail --msgbox "Installation von ${editor_pkg[$choice]}..." 8 50
sudo apt update sudo apt update
sudo apt install -y "$choice" sudo apt install -y "${editor_pkg[$choice]}"
if command -v "$choice" >/dev/null 2>&1; then if command -v "$choice" >/dev/null 2>&1; then
whiptail --msgbox "$choice erfolgreich installiert." 8 50 whiptail --msgbox "$choice erfolgreich installiert." 8 50
jq --arg ed "$choice" '.editor = $ed' "$GLOBAL_CONFIG" >"$GLOBAL_CONFIG.tmp" && mv "$GLOBAL_CONFIG.tmp" "$GLOBAL_CONFIG" jq --arg ed "$choice" '.editor = $ed' "$GLOBAL_CONFIG" >"$GLOBAL_CONFIG.tmp" && mv "$GLOBAL_CONFIG.tmp" "$GLOBAL_CONFIG"

0
start.sh Normal file → Executable file
View File