补充插件通信审查证据与覆盖记录
This commit is contained in:
1 parent
8e50cc6081
commit
9849f8f11c
30 files changed
+3899
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import { mkdirSync, writeFileSync } from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import path from 'node:path'
|
||||
|
||||
const root = fileURLToPath(new URL('../../', import.meta.url))
|
||||
const directory = path.join(root, 'test-log', `review-windows-${Date.now()}`)
|
||||
mkdirSync(directory, { recursive: true })
|
||||
// Windows PowerShell 5 使用显式 UTF-8 读取,避免依赖系统代码页解释测试源码。
|
||||
const command = `
|
||||
[Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)
|
||||
$source = [IO.File]::ReadAllText('test/review/windows-install-findings.ps1', [Text.Encoding]::UTF8)
|
||||
& ([scriptblock]::Create($source)) -WorkspaceRoot (Get-Location).Path
|
||||
`
|
||||
const result = spawnSync('powershell.exe', ['-NoProfile', '-Command', command], {
|
||||
cwd: root, encoding: 'utf8', windowsHide: true
|
||||
})
|
||||
writeFileSync(path.join(directory, 'windows.log'), (result.stdout || '') + (result.stderr || ''))
|
||||
process.stdout.write(result.stdout || '')
|
||||
process.stderr.write(result.stderr || '')
|
||||
if (result.error) console.error(result.error)
|
||||
console.log(`测试记录:${path.relative(root, directory)}`)
|
||||
process.exitCode = result.status ?? 1
|
||||
Reference in new issue
Block a user