19 lines
1.0 KiB
PowerShell
19 lines
1.0 KiB
PowerShell
[CmdletBinding()]
|
|
param(
|
|
[string]$WorkshopRoot = 'D:\SteamLibrary\steamapps\workshop\content\108600',
|
|
[string]$GameDirectory = 'D:\SteamLibrary\steamapps\common\ProjectZomboid',
|
|
[string]$OutputDirectory = (Split-Path -Parent $PSScriptRoot),
|
|
[switch]$Install,
|
|
[string]$LocalModsDirectory = (Join-Path $env:USERPROFILE 'Zomboid\mods'),
|
|
[string]$PythonExecutable = (Join-Path $env:USERPROFILE '.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe')
|
|
)
|
|
$ErrorActionPreference = 'Stop'
|
|
if (!(Test-Path -LiteralPath $PythonExecutable)) {
|
|
throw 'Pass -PythonExecutable with a Python 3.10+ interpreter containing Pillow.'
|
|
}
|
|
$scriptArguments = @((Join-Path $PSScriptRoot 'Match-KnoxViewpoint.py'), '--workshop-root', $WorkshopRoot,
|
|
'--game-directory', $GameDirectory, '--output-directory', $OutputDirectory, '--local-mods-directory', $LocalModsDirectory)
|
|
if ($Install) { $scriptArguments += '--install' }
|
|
& $PythonExecutable @scriptArguments
|
|
if ($LASTEXITCODE -ne 0) { throw "Matcher failed with exit code $LASTEXITCODE" }
|