change packagename to neovim
This commit is contained in:
19
scripts/image-builder.sh
Normal file → Executable file
19
scripts/image-builder.sh
Normal file → Executable file
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user