Warn about unmatched map names, and exit early when no maps are matched

This commit is contained in:
Steve Streeting 2020-10-06 16:52:06 +01:00
parent 803dbc2cd7
commit a340cc58dd

View File

@ -61,12 +61,19 @@ try {
if ($maps) { if ($maps) {
# Explicit list of maps provided on command line # Explicit list of maps provided on command line
$mapsToRebuild = Find-File-Set -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$false -includeBaseNames:$maps $mapsToRebuild = Find-File-Set -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$false -includeBaseNames:$maps
if ($mapsToRebuild.Count -ne $maps.Count) {
Write-Warning "Ignoring missing map(s): $($maps | Where-Object { $_ -notin $mapsToRebuild })"
}
} else { } else {
# Derive maps from cook settings # Derive maps from cook settings
$mapsToRebuild = Find-File-Set -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$config.CookAllMaps -includeBaseNames:$config.MapsIncluded -excludeBaseNames:$config.MapsExcluded $mapsToRebuild = Find-File-Set -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$config.CookAllMaps -includeBaseNames:$config.MapsIncluded -excludeBaseNames:$config.MapsExcluded
} }
# TODO check maps not found if ($mapsToRebuild.Count -eq 0) {
throw "No maps found to rebuild"
}
# TODO lock map files if read-only # TODO lock map files if read-only
if (-not $quality) { if (-not $quality) {
@ -114,6 +121,7 @@ try {
} catch { } catch {
Write-Output $_.Exception.Message Write-Output $_.Exception.Message
Write-Output "~-~-~ UE4 Lightmap Rebuild FAILED ~-~-~"
Exit 9 Exit 9
} }