Files
tizi/codexpro.ps1
2026-07-29 20:45:14 +08:00

20 lines
903 B
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
$NodeDir = "C:\Users\wyc\AppData\Roaming\JetBrains\CLion2026.1\node\versions\24.14.1"
$ProjectDir = "D:\ae\tools\tizi"
$NodeExe = Join-Path $NodeDir "node.exe"
if (!(Test-Path -LiteralPath $NodeExe -PathType Leaf)) {
throw "Node.js 不存在:$NodeExe"
}
if (!(Test-Path -LiteralPath $ProjectDir -PathType Container)) {
throw "项目目录不存在:$ProjectDir"
}
$env:Path = "$NodeDir;$env:Path"
$CodexProCommand = Get-Command "codexpro" -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1
if ($null -eq $CodexProCommand) {
throw "PATH 中找不到 codexpro 命令。请先执行:Get-Command codexpro -All"
}
Write-Host "Node.js$(& $NodeExe --version)"
Write-Host "CodexPro$($CodexProCommand.Source)"
Write-Host "项目目录:$ProjectDir"
Set-Location -LiteralPath $ProjectDir
& $CodexProCommand.Source start --root $ProjectDir
exit $LASTEXITCODE