chore(docs): GitHub repo URLs, remove .cursor from git, mirror scripts
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# Push main to a mirror remote with host-specific doc URLs, without leaving URL churn on main.
|
||||
# Usage: .\scripts\Push-Mirror.ps1 github|kalinamall|papatramp
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidateSet('github', 'kalinamall', 'papatramp')]
|
||||
[string]$Target
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$Root = Split-Path -Parent $PSScriptRoot
|
||||
Set-Location $Root
|
||||
|
||||
$remote = switch ($Target) {
|
||||
'github' { 'github' }
|
||||
'kalinamall' { 'kalinamall' }
|
||||
'papatramp' { 'papatramp' }
|
||||
}
|
||||
|
||||
git remote get-url $remote 2>$null | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "remote not configured: $remote"
|
||||
}
|
||||
|
||||
if ((git status --porcelain)) {
|
||||
throw 'working tree not clean; commit or stash first'
|
||||
}
|
||||
|
||||
$before = (git rev-parse HEAD).Trim()
|
||||
& "$PSScriptRoot\Rewrite-GitHostUrls.ps1" -Target $Target
|
||||
|
||||
if (-not (git status --porcelain)) {
|
||||
Write-Output "no URL changes for $Target; pushing as-is"
|
||||
git push $remote main
|
||||
exit 0
|
||||
}
|
||||
|
||||
git add -A
|
||||
git commit -m "chore(docs): sync repository URLs for ${Target} mirror"
|
||||
git push $remote main
|
||||
git reset --hard $before
|
||||
Write-Output "pushed $remote with ${Target} URLs; local main reset to $before"
|
||||
Reference in New Issue
Block a user