aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--beepzone-helper.ps146
-rwxr-xr-xbeepzone-helper.sh50
2 files changed, 90 insertions, 6 deletions
diff --git a/beepzone-helper.ps1 b/beepzone-helper.ps1
index 1b8e47c..fd74800 100644
--- a/beepzone-helper.ps1
+++ b/beepzone-helper.ps1
@@ -750,6 +750,46 @@ function Setup-SeckelAPI {
Read-Host "`nPress Enter to continue"
}
+function Update-FromGitMasters {
+ $seckelapiSources = Join-Path $WORK_DIR "backend\seckelapi\sources"
+ $clientSources = Join-Path $WORK_DIR "frontend\desktop-client\sources"
+
+ $confirm = Read-Host "`nThis will run 'git pull' in both backend and frontend source directories. Continue? (y/n)"
+ if ($confirm -ne 'y') { return }
+
+ Write-Host "`nUpdating sources from git masters..." -ForegroundColor Yellow
+
+ # Update SeckelAPI
+ if (Test-Path (Join-Path $seckelapiSources ".git")) {
+ Write-Host "Updating SeckelAPI..." -ForegroundColor Cyan
+ Push-Location $seckelapiSources
+ try {
+ git pull
+ } catch {
+ Write-Host "Failed to update SeckelAPI: $_" -ForegroundColor Red
+ }
+ Pop-Location
+ } else {
+ Write-Host "SeckelAPI sources not found or not a git repository. Skipping." -ForegroundColor DarkGray
+ }
+
+ # Update Desktop Client
+ if (Test-Path (Join-Path $clientSources ".git")) {
+ Write-Host "`nUpdating Desktop Client..." -ForegroundColor Cyan
+ Push-Location $clientSources
+ try {
+ git pull
+ } catch {
+ Write-Host "Failed to update Desktop Client: $_" -ForegroundColor Red
+ }
+ Pop-Location
+ } else {
+ Write-Host "Desktop Client sources not found or not a git repository. Skipping." -ForegroundColor DarkGray
+ }
+
+ Read-Host "`nPress Enter to continue"
+}
+
function Clean-Sources {
Write-Host "`n=== Clean Sources ==="-ForegroundColor Cyan
Write-Host "This will delete all sources directories including hidden files." -ForegroundColor Yellow
@@ -866,6 +906,7 @@ while ($true) {
"Manage users & roles",
"Configure & setup SeckelAPI",
"Build desktop client",
+ "Update from git masters",
"Clean sources",
"Quit"
)
@@ -876,7 +917,8 @@ while ($true) {
3 { Manage-Users }
4 { Setup-SeckelAPI }
5 { Build-DesktopClient }
- 6 { Clean-Sources }
- 7 { exit 0 }
+ 6 { Update-FromGitMasters }
+ 7 { Clean-Sources }
+ 8 { exit 0 }
}
}
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