From 045db604eeb56eba9d3d8c539acb5ed66fae90ed Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Fri, 14 May 2021 11:28:32 +0100 Subject: [PATCH] Only fail to sync if changes include .umap files --- ue4-datasync.ps1 | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/ue4-datasync.ps1 b/ue4-datasync.ps1 index fc3f214..59b8065 100644 --- a/ue4-datasync.ps1 +++ b/ue4-datasync.ps1 @@ -89,27 +89,21 @@ if (-not $umapsOK) { Exit 5 } -# Check no changes -git diff --no-patch --exit-code -if ($LASTEXITCODE -ne 0) { - Write-Output "Working copy is not clean (unstaged changes)" - if ($dryrun) { - Write-Output "dryrun: Continuing but this will fail without -dryrun" - } else { - Exit $LASTEXITCODE +# Check no changes, ONLY to .umap files +$statusOutput = git status --porcelain *.umap +foreach ($line in $statusOutput) { + if ($line -like "*.umap*") { + Write-Output "Uncommitted changes to .umap file(s) detected" + if ($dryrun) { + Write-Output "dryrun: Continuing but this will fail without -dryrun" + 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