47 lines
1.4 KiB
PowerShell
47 lines
1.4 KiB
PowerShell
# Push PDF-Downloaders repo to Gitea.
|
|
# Sign in at https://git.masengr.com first; use a Personal Access Token if prompted.
|
|
#
|
|
# 1. Sync Scribd project: cd "..\Scribe PDF Downloader"; .\scripts\sync-to-pdf-downloaders.ps1
|
|
# 2. Push: cd "..\PDF-Downloaders"; .\push-to-gitea.ps1
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$RepoRoot = $PSScriptRoot
|
|
$Remote = "https://git.masengr.com/Michael-A-Sloan/PDF-Downloaders.git"
|
|
|
|
Set-Location $RepoRoot
|
|
|
|
if (-not (Test-Path "Scribd\README.md")) {
|
|
Write-Host "Scribd folder missing. Run sync first:" -ForegroundColor Yellow
|
|
Write-Host ' cd "..\Scribe PDF Downloader"'
|
|
Write-Host ' .\scripts\sync-to-pdf-downloaders.ps1'
|
|
exit 1
|
|
}
|
|
|
|
if (-not (Test-Path ".git")) {
|
|
git init
|
|
git branch -M main
|
|
}
|
|
|
|
$remotes = git remote 2>$null
|
|
if ($remotes -notcontains "origin") {
|
|
git remote add origin $Remote
|
|
} else {
|
|
git remote set-url origin $Remote
|
|
}
|
|
|
|
git add -A
|
|
$status = git status --porcelain
|
|
if (-not $status) {
|
|
Write-Host "Nothing to commit." -ForegroundColor Yellow
|
|
} else {
|
|
git commit -m "Add Scribd PDF Downloader"
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "Pushing to $Remote ..." -ForegroundColor Cyan
|
|
Write-Host "(Use your Gitea username + Personal Access Token as password if asked)"
|
|
git push -u origin main
|
|
|
|
Write-Host ""
|
|
Write-Host "Done: https://git.masengr.com/Michael-A-Sloan/PDF-Downloaders" -ForegroundColor Green
|