/
dgrigorev
/
veda
Обзор
Документация
Войти
/
dgrigorev
/
veda
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
scripts/setup.ps1
59 строк
2 KB
Дмитрий Григорьев
Improve terminal theming and rendering
02 июн 2026, 01:59
02 июн 2026, 01:59
b1766a7
Код
Авторство
О чём код?
<# .SYNOPSIS Initializes a Windows development environment for Veda. .DESCRIPTION Installs Rust if missing, adds required Rust components, installs optional quality tools, and configures pre-commit hooks when Python/pre-commit exists. #> [CmdletBinding()] param( [switch]$SkipCargoTools, [switch]$SkipPreCommit ) $ErrorActionPreference = "Stop" $RepoRoot = Split-Path -Parent $PSScriptRoot Set-Location $RepoRoot function Test-Command($Name) { return $null -ne (Get-Command $Name -ErrorAction SilentlyContinue) } Write-Host "=== Veda Windows setup ===" -ForegroundColor Cyan if (-not (Test-Command rustup)) { Write-Host "rustup not found. Installing Rust via rustup-init..." -ForegroundColor Yellow $Installer = Join-Path $env:TEMP "rustup-init.exe" Invoke-WebRequest -Uri "https://win.rustup.rs/x86_64" -OutFile $Installer & $Installer -y --default-toolchain stable $CargoBin = Join-Path $env:USERPROFILE ".cargo\bin" $env:PATH = "$CargoBin;$env:PATH" } rustup show rustup component add rustfmt clippy rustup target add x86_64-pc-windows-msvc if (-not $SkipCargoTools) { Write-Host "Installing cargo-audit and cargo-tarpaulin..." -ForegroundColor Yellow cargo install cargo-audit --locked cargo install cargo-tarpaulin --locked } if (-not $SkipPreCommit) { if (Test-Command pre-commit) { pre-commit install } elseif (Test-Command python) { python -m pip install --user pre-commit $Scripts = Join-Path $env:APPDATA "Python\Python313\Scripts" if (Test-Path $Scripts) { $env:PATH = "$Scripts;$env:PATH" } pre-commit install } else { Write-Host "Python/pre-commit not found. Skipping pre-commit hook installation." -ForegroundColor Yellow } } Write-Host "Running initial cargo check..." -ForegroundColor Yellow cargo check --all-targets --locked Write-Host "Veda setup completed." -ForegroundColor Green