edit function edit_project_files

This commit is contained in:
2025-09-26 15:13:09 +02:00
parent 8acfb84de3
commit 7d915977ce

View File

@@ -335,6 +335,7 @@ get_editor_cmd() {
} }
# Projektdateien bearbeiten (Dateiauswahl + Editor) # Projektdateien bearbeiten (Dateiauswahl + Editor)
# Projektdateien bearbeiten mit dialog-Dateimanager
edit_project_files() { edit_project_files() {
local project=$1 local project=$1
local project_dir="$PROJECTS_DIR/$project" local project_dir="$PROJECTS_DIR/$project"
@@ -345,27 +346,20 @@ edit_project_files() {
return return
fi fi
# 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
[[ -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)
# dialog-Dateiauswahl
local file
file=$(dialog --title "Datei auswählen" --fselect "$project_dir/" 20 70 3>&1 1>&2 2>&3) || return
[[ -z "$file" ]] && return
# Datei im Editor öffnen # Datei im Editor öffnen
"$editor_cmd" "$file" "$editor_cmd" "$file"
} }
edit_project_architectures() { edit_project_architectures() {
local config_file=$1 local config_file=$1
local current=$(grep "^architectures=" "$config_file" | cut -d= -f2 | tr ',' ' ') local current=$(grep "^architectures=" "$config_file" | cut -d= -f2 | tr ',' ' ')