34 lines
889 B
PowerShell
34 lines
889 B
PowerShell
# BFG.ps1 (run from C:\vibe\auctiora\scripts)
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
# 1) Download BFG jar once, next to this script
|
|
$bfgJar = Join-Path $PSScriptRoot "bfg.jar"
|
|
if (-not (Test-Path $bfgJar)) {
|
|
Invoke-WebRequest `
|
|
"https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar" `
|
|
-OutFile $bfgJar
|
|
}
|
|
|
|
# 2) Clone bare mirror next to project root: C:\vibe\auctiora\auctiora.git
|
|
$rootDir = Join-Path $PSScriptRoot ".."
|
|
$mirrorPath = Join-Path $rootDir "auctiora.git"
|
|
|
|
if (Test-Path $mirrorPath) {
|
|
Remove-Item $mirrorPath -Recurse -Force
|
|
}
|
|
|
|
git clone --mirror "https://git.appmodel.nl/Tour/auctiora.git" $mirrorPath
|
|
|
|
# 3) Run BFG in mirror
|
|
Push-Location $mirrorPath
|
|
|
|
java -jar $bfgJar --strip-blobs-bigger-than 50M .
|
|
|
|
git reflog expire --expire=now --all
|
|
git gc --prune=now --aggressive
|
|
|
|
# 4) Force-push cleaned history
|
|
git push --force
|
|
|
|
Pop-Location
|