2026-02-23 20:12:10 -06:00

43 lines
1.9 KiB
PowerShell

# Run this in PowerShell before development commands:
# . ./scripts/dev-shell.ps1
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
# Clear dead proxy overrides and offline-only pip mode in current shell.
Remove-Item Env:HTTP_PROXY -ErrorAction SilentlyContinue
Remove-Item Env:HTTPS_PROXY -ErrorAction SilentlyContinue
Remove-Item Env:ALL_PROXY -ErrorAction SilentlyContinue
Remove-Item Env:http_proxy -ErrorAction SilentlyContinue
Remove-Item Env:https_proxy -ErrorAction SilentlyContinue
Remove-Item Env:all_proxy -ErrorAction SilentlyContinue
Remove-Item Env:GIT_HTTP_PROXY -ErrorAction SilentlyContinue
Remove-Item Env:GIT_HTTPS_PROXY -ErrorAction SilentlyContinue
Remove-Item Env:PIP_NO_INDEX -ErrorAction SilentlyContinue
# Keep .NET artifacts local to repo to avoid restricted user-profile paths.
$env:DOTNET_CLI_HOME = Join-Path $repoRoot ".dotnet_home"
$env:NUGET_PACKAGES = Join-Path $repoRoot ".nuget\packages"
$env:NUGET_HTTP_CACHE_PATH = Join-Path $repoRoot ".nuget\http-cache"
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "1"
$env:DOTNET_ADD_GLOBAL_TOOLS_TO_PATH = "0"
$env:DOTNET_GENERATE_ASPNET_CERTIFICATE = "0"
$env:DOTNET_CLI_TELEMETRY_OPTOUT = "1"
$env:NUGET_CERT_REVOCATION_MODE = "offline"
# Keep pip artifacts local to repo.
$env:PIP_CACHE_DIR = Join-Path $repoRoot ".pip\cache"
$env:TEMP = Join-Path $repoRoot ".tmp\pip-temp"
$env:TMP = $env:TEMP
$env:PIP_DISABLE_PIP_VERSION_CHECK = "1"
$env:PIP_DEFAULT_TIMEOUT = "30"
$env:PIP_RETRIES = "2"
# Keep Hugging Face cache local and silence symlink-only warning on Windows.
$env:HF_HOME = Join-Path $repoRoot ".cache\huggingface"
$env:HUGGINGFACE_HUB_CACHE = Join-Path $env:HF_HOME "hub"
$env:HF_HUB_DISABLE_SYMLINKS_WARNING = "1"
New-Item -ItemType Directory -Force -Path $env:DOTNET_CLI_HOME,$env:NUGET_PACKAGES,$env:NUGET_HTTP_CACHE_PATH,$env:PIP_CACHE_DIR,$env:TEMP,$env:HUGGINGFACE_HUB_CACHE | Out-Null
Write-Host "Development shell initialized for repo-local dotnet/pip paths."