251206:1605 docs: update README and patch 2git.ps1
This commit is contained in:
38
2git.ps1
38
2git.ps1
@@ -1,14 +1,38 @@
|
|||||||
param([string]$Message = "Backup")
|
param([string]$Message = "Backup")
|
||||||
|
|
||||||
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
$Timestamp = Get-Date -Format "yyMMdd:HHmm"
|
||||||
$CommitMsg = "Backup: $Message | $Timestamp"
|
$CommitMsg = "$Timestamp $Message"
|
||||||
|
|
||||||
Write-Host "Backup: $CommitMsg" -ForegroundColor Cyan
|
Write-Host "📦 $CommitMsg" -ForegroundColor Cyan
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m $CommitMsg
|
|
||||||
git push origin main
|
|
||||||
git push github main
|
|
||||||
|
|
||||||
Write-Host "Done!" -ForegroundColor Green
|
# Check if anything to commit
|
||||||
|
$status = git status --porcelain
|
||||||
|
if (-not $status) {
|
||||||
|
Write-Host "⚠️ Nothing to commit" -ForegroundColor Yellow
|
||||||
|
pause
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
git commit -m $CommitMsg
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-Host "❌ Commit failed" -ForegroundColor Red
|
||||||
|
pause
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "🚀 Pushing to Gitea..." -ForegroundColor Cyan
|
||||||
|
git push origin main
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-Host "❌ Push to Gitea failed" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "🚀 Pushing to GitHub..." -ForegroundColor Cyan
|
||||||
|
git push github main
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-Host "❌ Push to GitHub failed" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "✅ Done!" -ForegroundColor Green
|
||||||
pause
|
pause
|
||||||
|
|||||||
Reference in New Issue
Block a user