mirror of
https://github.com/sinbad/UEScripts.git
synced 2025-02-23 13:15:23 +00:00
Finer-grained checking of umap files for modifications
Ignore untracked umaps, and allow push/pull for unmodified umaps while there are modifications for other maps.
This commit is contained in:
parent
03479c2e2f
commit
f17a961d79
@ -140,19 +140,16 @@ if (-not $umapsOK) {
|
||||
Exit 5
|
||||
}
|
||||
|
||||
# Check no changes, ONLY to .umap files
|
||||
$statusOutput = git status --porcelain *.umap
|
||||
# Check for changes, ONLY to .umap files
|
||||
$statusOutput = git status -uno --porcelain *.umap
|
||||
$modifiedMaps = [System.Collections.ArrayList]@()
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
if ($line -match "^(?: [^\s]|[^\s] |[^\s][^\s])\s+(.+)$") {
|
||||
$filename = $matches[1]
|
||||
$modifiedMaps.Add($filename) > $null
|
||||
|
||||
Write-Warning "Uncommitted change: $filename (will be skipped)"
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,6 +196,11 @@ try {
|
||||
|
||||
Write-Verbose "Checking $filename ($oid)"
|
||||
|
||||
if ($modifiedMaps.Contains($filename)) {
|
||||
Write-Verbose "Skipping $filename, uncommitted changes"
|
||||
continue
|
||||
}
|
||||
|
||||
$localbuiltdata, $remotebuiltdata = Get-Builtdata-Paths $umap $syncdir
|
||||
|
||||
$same = Compare-Files-Quick $localbuiltdata $remotebuiltdata
|
||||
|
Loading…
x
Reference in New Issue
Block a user