aboutsummaryrefslogtreecommitdiff
path: root/beepzone-helper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'beepzone-helper.sh')
-rwxr-xr-xbeepzone-helper.sh50
1 files changed, 46 insertions, 4 deletions
diff --git a/beepzone-helper.sh b/beepzone-helper.sh
index f8d1e59..f7b9ccb 100755
--- a/beepzone-helper.sh
+++ b/beepzone-helper.sh
@@ -110,8 +110,9 @@ ask_main_menu() {
3 "Manage users & roles" \
4 "Configure & setup SeckelAPI" \
5 "Build desktop client" \
- 6 "Clean sources" \
- 7 "Quit" 2>"$CHOICE_FILE"
+ 6 "Update from git masters" \
+ 7 "Clean sources" \
+ 8 "Quit" 2>"$CHOICE_FILE"
choice=$(<"$CHOICE_FILE")
case $choice in
@@ -120,8 +121,9 @@ ask_main_menu() {
3) manage_users_and_roles ;;
4) setup_seckelapi ;;
5) build_desktop_client ;;
- 6) clean_sources ;;
- 7) exit 0 ;;
+ 6) update_from_git_masters ;;
+ 7) clean_sources ;;
+ 8) exit 0 ;;
esac
done
}
@@ -690,6 +692,46 @@ setup_seckelapi() {
fi
}
+update_from_git_masters() {
+ local seckelapi_sources="$WORK_DIR/backend/seckelapi/sources"
+ local client_sources="$WORK_DIR/frontend/desktop-client/sources"
+
+ if $DIALOG --yesno "This will run 'git pull' in both backend and frontend source directories.\n\nContinue?" 10 60; then
+ clear
+ echo "Updating sources from git masters..."
+ echo "===================================="
+ echo ""
+
+ # Update SeckelAPI
+ if [[ -d "$seckelapi_sources/.git" ]]; then
+ echo "Updating SeckelAPI..."
+ if (cd "$seckelapi_sources" && git pull); then
+ echo "SeckelAPI updated successfully."
+ else
+ echo "Failed to update SeckelAPI."
+ fi
+ else
+ echo "SeckelAPI sources not found or not a git repository. Skipping."
+ fi
+ echo ""
+
+ # Update Desktop Client
+ if [[ -d "$client_sources/.git" ]]; then
+ echo "Updating Desktop Client..."
+ if (cd "$client_sources" && git pull); then
+ echo "Desktop Client updated successfully."
+ else
+ echo "Failed to update Desktop Client."
+ fi
+ else
+ echo "Desktop Client sources not found or not a git repository. Skipping."
+ fi
+
+ echo ""
+ read -p "Press Enter to continue..."
+ fi
+}
+
clean_sources() {
$DIALOG --yesno "This will delete all sources directories including hidden files:\n\n- backend/seckelapi/sources\n- frontend/desktop-client/sources\n\nAre you sure?" 12 70 || return