28 lines
833 B
PowerShell
28 lines
833 B
PowerShell
# Publie une mise à jour du modpack : régénère le manifeste packwiz puis
|
|
# commit + push. À lancer APRÈS tes packwiz cf add / update / remove.
|
|
#
|
|
# Usage : .\update-pack.ps1 "ce que j'ai changé"
|
|
|
|
param(
|
|
[Parameter(Mandatory = $false)]
|
|
[string]$Message = "update modpack"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
Write-Host "==> packwiz refresh (recalcul des hash / index.toml)" -ForegroundColor Cyan
|
|
.\packwiz refresh
|
|
|
|
Write-Host "==> git commit + push" -ForegroundColor Cyan
|
|
git add -A
|
|
# Ne commit que s'il y a des changements
|
|
git diff --cached --quiet
|
|
if ($LASTEXITCODE -ne 0) {
|
|
git commit -m $Message
|
|
git push
|
|
Write-Host "==> Pack publie. Les joueurs recevront le delta au prochain lancement." -ForegroundColor Green
|
|
}
|
|
else {
|
|
Write-Host "==> Rien a publier (aucun changement)." -ForegroundColor Yellow
|
|
}
|