edit functions in edit_project menu
This commit is contained in:
@@ -250,6 +250,7 @@ edit_project() {
|
|||||||
projects=$(ls "$PROJECT_CONFIG_DIR" 2>/dev/null)
|
projects=$(ls "$PROJECT_CONFIG_DIR" 2>/dev/null)
|
||||||
[ -z "$projects" ] && { whiptail --msgbox "Keine Projekte vorhanden." 10 60; return; }
|
[ -z "$projects" ] && { whiptail --msgbox "Keine Projekte vorhanden." 10 60; return; }
|
||||||
|
|
||||||
|
# Projekte für Menü vorbereiten (immer 2 Spalten)
|
||||||
menu_list=()
|
menu_list=()
|
||||||
for p in $projects; do
|
for p in $projects; do
|
||||||
menu_list+=("$p" "")
|
menu_list+=("$p" "")
|
||||||
@@ -257,17 +258,18 @@ edit_project() {
|
|||||||
|
|
||||||
project=$(whiptail --menu "Projekt auswählen:" 20 60 10 "${menu_list[@]}" 3>&1 1>&2 2>&3) || return
|
project=$(whiptail --menu "Projekt auswählen:" 20 60 10 "${menu_list[@]}" 3>&1 1>&2 2>&3) || return
|
||||||
local config_file="$PROJECT_CONFIG_DIR/$project/config-file"
|
local config_file="$PROJECT_CONFIG_DIR/$project/config-file"
|
||||||
|
local project_dir="$PROJECTS_DIR/$project"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
repo_url=$(grep "^git_repo=" "$config_file" | cut -d= -f2)
|
repo_url=$(grep "^git_repo=" "$config_file" | cut -d= -f2)
|
||||||
|
|
||||||
menu_items=(
|
menu_items=(
|
||||||
1 "Registry ändern"
|
1 "Registries auswählen"
|
||||||
2 "Image-Name ändern"
|
2 "Architekturen auswählen"
|
||||||
3 "Architekturen setzen"
|
3 "Push aktivieren/deaktivieren"
|
||||||
4 "Push-Option setzen"
|
4 "Latest-Tag setzen/entfernen"
|
||||||
5 "Version/Subversion ändern"
|
5 "Version/Subversion ändern"
|
||||||
6 "Latest-Tag setzen"
|
6 "Automatische Subversion"
|
||||||
7 "Projektdateien bearbeiten"
|
7 "Projektdateien bearbeiten"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -281,14 +283,14 @@ edit_project() {
|
|||||||
3>&1 1>&2 2>&3) || return
|
3>&1 1>&2 2>&3) || return
|
||||||
|
|
||||||
case $choice in
|
case $choice in
|
||||||
1) change_project_setting "$config_file" "registry" ;;
|
1) edit_project_registries "$config_file" ;;
|
||||||
2) change_project_setting "$config_file" "image_name" ;;
|
2) edit_project_architectures "$config_file" ;;
|
||||||
3) change_project_setting "$config_file" "architectures" ;;
|
3) edit_project_push "$config_file" ;;
|
||||||
4) change_project_setting "$config_file" "push" ;;
|
4) edit_project_latest "$config_file" ;;
|
||||||
5) change_project_setting "$config_file" "version" ;;
|
5) change_project_setting "$config_file" "version" ;;
|
||||||
6) change_project_setting "$config_file" "latest" ;;
|
6) edit_project_auto_subversion "$config_file" ;;
|
||||||
7) edit_project_files "$project" ;;
|
7) edit_project_files "$project" ;;
|
||||||
8) [ -n "$repo_url" ] && (cd "$PROJECTS_DIR/$project" && git pull || whiptail --msgbox "Git Pull fehlgeschlagen." 10 60) ;;
|
8) [ -n "$repo_url" ] && (cd "$project_dir" && git pull || whiptail --msgbox "Git Pull fehlgeschlagen." 10 60) ;;
|
||||||
0) return ;;
|
0) return ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user