-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate.ps1
More file actions
32 lines (24 loc) · 963 Bytes
/
update.ps1
File metadata and controls
32 lines (24 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# update.ps1 - Windows Update Script
# Usage: Right-click > "Run with PowerShell" or run from terminal: .\update.ps1
# Navigate to the script's directory
Set-Location $PSScriptRoot
Write-Host "Checking for updates..."
# Fetch latest changes
git fetch origin
# Compare local and remote hashes
$local = git rev-parse HEAD
$remote = git rev-parse "@{u}"
if ($local -ne $remote) {
Write-Host "Update found! Pulling changes..." -ForegroundColor Cyan
git pull origin main
if (Test-Path "requirements.txt") {
Write-Host "Updating dependencies..."
pip install -r requirements.txt
}
Write-Host "Update complete." -ForegroundColor Green
Write-Host "NOTE: You must manually restart 'manager.py' for changes to take effect." -ForegroundColor Yellow
} else {
Write-Host "No updates available. You are on the latest version." -ForegroundColor Green
}
# Keep window open briefly so user can read output
Start-Sleep -Seconds 5