Only fail to sync if changes include .umap files

This commit is contained in:
Steve Streeting 2021-05-14 11:28:32 +01:00
parent 552f972bf5
commit 045db604ee

View File

@ -89,27 +89,21 @@ if (-not $umapsOK) {
Exit 5 Exit 5
} }
# Check no changes # Check no changes, ONLY to .umap files
git diff --no-patch --exit-code $statusOutput = git status --porcelain *.umap
if ($LASTEXITCODE -ne 0) { foreach ($line in $statusOutput) {
Write-Output "Working copy is not clean (unstaged changes)" if ($line -like "*.umap*") {
if ($dryrun) { Write-Output "Uncommitted changes to .umap file(s) detected"
Write-Output "dryrun: Continuing but this will fail without -dryrun" if ($dryrun) {
} else { Write-Output "dryrun: Continuing but this will fail without -dryrun"
Exit $LASTEXITCODE break
} else {
Write-Output "Cannot continue"
Exit $LASTEXITCODE
}
} }
} }
git diff --no-patch --cached --exit-code
if ($LASTEXITCODE -ne 0) {
Write-Output "Working copy is not clean (staged changes)"
if ($dryrun) {
Write-Output "dryrun: Continuing but this will fail without -dryrun"
} else {
Exit $LASTEXITCODE
}
}
$result = 0 $result = 0