fix: 修复 Sense Windows 包白屏 (#70)
This commit is contained in:
@@ -28,11 +28,20 @@ foreach ($name in $script:SenseAllowedEnvironment) {
|
||||
[Environment]::SetEnvironmentVariable($name, $null, 'Process')
|
||||
}
|
||||
try {
|
||||
New-Item -ItemType Directory -Path (Join-Path $temporary 'config'), (Join-Path $temporary 'web'), (Join-Path $temporary 'bin') | Out-Null
|
||||
[IO.File]::WriteAllText((Join-Path $temporary 'web\index.html'), 'sense', (New-Object Text.UTF8Encoding($false)))
|
||||
New-Item -ItemType Directory -Path (Join-Path $temporary 'config'), (Join-Path $temporary 'web'), (Join-Path $temporary 'web\js'), (Join-Path $temporary 'bin') | Out-Null
|
||||
$webIndex = '<div id="app"></div><script src="/js/runtime.fixture.js"></script>'
|
||||
[IO.File]::WriteAllText((Join-Path $temporary 'web\index.html'), $webIndex, (New-Object Text.UTF8Encoding($false)))
|
||||
[IO.File]::WriteAllText((Join-Path $temporary 'web\js\runtime.fixture.js'), 'fixture', (New-Object Text.UTF8Encoding($false)))
|
||||
[IO.File]::WriteAllText((Join-Path $temporary 'bin\mediamtx.exe'), 'fixture', (New-Object Text.UTF8Encoding($false)))
|
||||
[IO.File]::WriteAllText((Join-Path $temporary 'config\mediamtx.yml'), 'api: true', (New-Object Text.UTF8Encoding($false)))
|
||||
|
||||
$webAssetAudit = Join-Path $senseRoot 'scripts\build\assert-web-assets.ps1'
|
||||
& $webAssetAudit -WebRoot (Join-Path $temporary 'web')
|
||||
Assert-True $true 'web asset audit must accept existing local references'
|
||||
Remove-Item -LiteralPath (Join-Path $temporary 'web\js\runtime.fixture.js')
|
||||
Assert-Throws { & $webAssetAudit -WebRoot (Join-Path $temporary 'web') } 'missing local asset' 'web asset audit must reject missing runtime files'
|
||||
[IO.File]::WriteAllText((Join-Path $temporary 'web\js\runtime.fixture.js'), 'fixture', (New-Object Text.UTF8Encoding($false)))
|
||||
|
||||
$listener = New-Object Net.Sockets.TcpListener([Net.IPAddress]::Loopback, 0)
|
||||
$listener.Start()
|
||||
$dbPort = ([Net.IPEndPoint]$listener.LocalEndpoint).Port
|
||||
|
||||
Reference in New Issue
Block a user