XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEWarframe

【WinUI】基于Warframe游戏本体的公开服务器以及安装器

公开
关注 0 Fork 0 Star 0
UTF-8
#requires -Version 7.0
# Read-only verification; does not stage files, change remotes or print credentials.
$ErrorActionPreference = 'Stop'
$taskRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
Push-Location $taskRoot
try {
    git rev-parse --is-inside-work-tree | Out-Null
    if ($LASTEXITCODE -ne 0) { throw 'Not a Git working tree.' }
    $taskIgnored = @(
        'Server/XFEWarframe.Server/bin/Debug/server.dll', 'Client/XFEWarframe.Player/obj/project.assets.json',
        '.vs/workspace.suo', 'artifacts/package/Client/XFEWarframe.Player.exe',
        'Server/runtime/server.json', 'runtime/state.json', 'Server/runtime/inventory-backups/save.json',
        'test/ProfilesRoot/Profiles/SystemProfile.json', 'test/Credentials/login.dat',
        '.env', '.env.local', 'local.pfx', 'local.key', 'server.log', 'TestResults/result.trx',
        'scripts/__pycache__/audit.pyc'
    )
    foreach ($taskPath in $taskIgnored) {
        git check-ignore -q --no-index -- $taskPath
        if ($LASTEXITCODE -ne 0) { throw "Generated or private path is not ignored: $taskPath" }
    }
    $taskSources = @(
        'Client/XFEWarframe.Client/Runtime/RuntimeControlServer.cs',
        'Client/XFEWarframe.Player/Profiles/CrossVersionProfiles/SystemProfile.cs',
        'Client/SharedUI/Localization/translations.json', 'Server/data/inventory-defaults.json',
        'Client/XFEWarframe.Player/Properties/launchSettings.json', '.env.example'
    )
    foreach ($taskPath in $taskSources) {
        git check-ignore -q --no-index -- $taskPath
        if ($LASTEXITCODE -eq 0) { throw "Required source is ignored: $taskPath" }
    }
    $taskTrackedPrivate = @(git ls-files --cached --ignored --exclude-standard)
    if ($taskTrackedPrivate.Count) { throw ('Ignored paths are already tracked: ' + ($taskTrackedPrivate -join ', ')) }
    git -c core.safecrlf=false diff --check
    if ($LASTEXITCODE -ne 0) { throw 'Whitespace errors in the working diff.' }
    git -c core.safecrlf=false diff --cached --check
    if ($LASTEXITCODE -ne 0) { throw 'Whitespace errors in the staged diff.' }
    Write-Output "PASS Git: $($taskIgnored.Count) private/generated paths ignored; $($taskSources.Count) source paths retained; no ignored files tracked; diff checks passed."
} finally { Pop-Location }