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