From 2f2e2a19e08437690052cd13a5ed197f79ac40ac Mon Sep 17 00:00:00 2001 From: pi-farm Date: Wed, 24 Sep 2025 00:10:29 +0200 Subject: [PATCH] change packagename to neovim --- scripts/image-builder.sh | 19 +++++++++++-------- start.sh | 0 2 files changed, 11 insertions(+), 8 deletions(-) mode change 100644 => 100755 scripts/image-builder.sh mode change 100644 => 100755 start.sh diff --git a/scripts/image-builder.sh b/scripts/image-builder.sh old mode 100644 new mode 100755 index ad40fea..c93ab6e --- a/scripts/image-builder.sh +++ b/scripts/image-builder.sh @@ -64,18 +64,21 @@ install_docker_and_buildx() { } 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=() declare -A editor_status # Prüfe, ob Editor installiert ist - for e in "${editors[@]}"; do - if command -v "$e" >/dev/null 2>&1; then - editor_status[$e]="(installiert)" + for cmd in "${!editor_pkg[@]}"; do + if command -v "$cmd" >/dev/null 2>&1; then + editor_status[$cmd]="(installiert)" else - editor_status[$e]="(nicht installiert)" + editor_status[$cmd]="(nicht installiert)" fi - options+=("$e" "${editor_status[$e]}") + options+=("$cmd" "${editor_status[$cmd]}") done while true; do @@ -89,9 +92,9 @@ set_editor() { 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) 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 install -y "$choice" + sudo apt install -y "${editor_pkg[$choice]}" if command -v "$choice" >/dev/null 2>&1; then whiptail --msgbox "$choice erfolgreich installiert." 8 50 jq --arg ed "$choice" '.editor = $ed' "$GLOBAL_CONFIG" >"$GLOBAL_CONFIG.tmp" && mv "$GLOBAL_CONFIG.tmp" "$GLOBAL_CONFIG" diff --git a/start.sh b/start.sh old mode 100644 new mode 100755