Initial clean project import

This commit is contained in:
cat-shark
2026-06-19 18:41:41 +08:00
commit a13b804c7a
1306 changed files with 220568 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
param(
[Parameter(Mandatory = $true)][string]$ProjectRoot,
[Parameter(Mandatory = $true)][string]$WorkerPath,
[Parameter(Mandatory = $true)][string]$JobsFile,
[Parameter(Mandatory = $true)][string]$SessionDir
)
$ErrorActionPreference = "Stop"
if (-not (Test-Path -LiteralPath $SessionDir)) {
New-Item -ItemType Directory -Path $SessionDir -Force | Out-Null
}
$node = (Get-Command node.exe -ErrorAction Stop).Source
$stdout = Join-Path $SessionDir "launcher-worker.stdout.log"
$stderr = Join-Path $SessionDir "launcher-worker.stderr.log"
$pidFile = Join-Path $SessionDir "worker.pid"
$process = Start-Process `
-FilePath $node `
-ArgumentList @($WorkerPath, $JobsFile, $SessionDir) `
-WorkingDirectory $ProjectRoot `
-WindowStyle Hidden `
-RedirectStandardOutput $stdout `
-RedirectStandardError $stderr `
-PassThru
Set-Content -LiteralPath $pidFile -Value $process.Id -Encoding UTF8
Write-Output $process.Id