edit function edit_project_files

This commit is contained in:
2025-09-26 15:09:29 +02:00
parent 28cdc076d7
commit 8acfb84de3

View File

@@ -339,26 +339,30 @@ edit_project_files() {
local project=$1
local project_dir="$PROJECTS_DIR/$project"
# Prüfen ob Projektordner existiert
if [[ ! -d "$project_dir" ]]; then
whiptail --msgbox "Projektordner nicht gefunden." 10 60
return
fi
# Datei auswählen (Abbrechen = zurück ins Menü, Script stürzt nicht ab)
if ! file=$(whiptail --title "Datei auswählen" \
--fselect "$project_dir/" 20 70 \
3>&1 1>&2 2>&3); then
# Prüfen ob der Ordner Dateien enthält
if [[ -z $(find "$project_dir" -type f | head -n 1) ]]; then
whiptail --msgbox "Keine Dateien im Projektordner vorhanden." 10 60
return
fi
# Datei auswählen
if ! file=$(whiptail --title "Datei auswählen" --fselect "$project_dir/" 20 70 3>&1 1>&2 2>&3); then
return
fi
# Wenn kein File gewählt, zurück
[[ -z "$file" ]] && return
# Editor aus globaler Config holen
local editor_cmd
editor_cmd=$(get_editor_cmd)
# Datei im gewählten Editor öffnen
# Datei im Editor öffnen
"$editor_cmd" "$file"
}