Files
workspace/fix-pyenv-path.ps1
aitest 15c4480db1 Add OpenClaw workspace configuration and tools
- Add agent configuration files (AGENTS.md, USER.md, IDENTITY.md, SOUL.md)
- Add git configuration and skills management scripts
- Add frontend/backend analysis tools and reports
- Add DingTalk media sender utilities and documentation
- Fix OpenClaw runtime environment (Node.js and Python)
- Configure git remotes and push scripts
2026-03-05 13:56:59 +09:00

39 lines
1.4 KiB
PowerShell

# Fix pyenv PATH permanently by adding to user environment
$PyenvShims = "F:\pyenv\pyenv-win\pyenv-win\shims"
$PyenvBin = "F:\pyenv\pyenv-win\pyenv-win\bin"
$PyenvRoot = "F:\pyenv\pyenv-win\pyenv-win"
# Get current user PATH
$CurrentUserPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
# Check if paths already exist
$pathsToAdd = @($PyenvShims, $PyenvBin, $PyenvRoot)
$existingPaths = $CurrentUserPath -split ';'
$newPathsToAdd = @()
foreach ($path in $pathsToAdd) {
if ($path -notin $existingPaths) {
$newPathsToAdd += $path
Write-Host "Adding $path to PATH" -ForegroundColor Green
} else {
Write-Host "$path already in PATH" -ForegroundColor Yellow
}
}
if ($newPathsToAdd.Count -gt 0) {
# Prepend new paths to existing PATH
$NewUserPath = ($newPathsToAdd + $existingPaths) -join ';'
# Set new user PATH
[System.Environment]::SetEnvironmentVariable("Path", $NewUserPath, "User")
Write-Host "`nPATH has been updated successfully!" -ForegroundColor Green
Write-Host "Please restart your terminal or session to apply changes." -ForegroundColor Yellow
} else {
Write-Host "No changes needed - all paths already configured" -ForegroundColor Cyan
}
# Also update current session
$env:Path = ($newPathsToAdd + $existingPaths) -join ';' + ";" + $env:Path
Write-Host "`nCurrent session PATH updated (temporary)" -ForegroundColor Cyan