55 lines
1.6 KiB
PowerShell
55 lines
1.6 KiB
PowerShell
#!/usr/bin/env pwsh
|
|
|
|
# KollectAI-ETL Bootstrap Setup
|
|
#
|
|
# Installs all required development tools and configures git hooks.
|
|
# Safe to re-run (idempotent) — skips tools that are already installed.
|
|
#
|
|
# Usage: pwsh ./setup.ps1
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
function Test-Command($Name) {
|
|
$null -ne (Get-Command $Name -ErrorAction SilentlyContinue)
|
|
}
|
|
|
|
function Install-Tool($Name, $ScriptBlock) {
|
|
if (Test-Command $Name) {
|
|
$version = & $Name --version 2>&1 | Select-Object -First 1
|
|
Write-Host "[OK] $Name already installed: $version" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "[INSTALL] Installing $Name..." -ForegroundColor Yellow
|
|
& $ScriptBlock
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host "[FAIL] Failed to install $Name" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
$version = & $Name --version 2>&1 | Select-Object -First 1
|
|
Write-Host "[OK] $Name installed: $version" -ForegroundColor Green
|
|
}
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "KollectAI-ETL Bootstrap Setup" -ForegroundColor Cyan
|
|
Write-Host "=============================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# 1. uv (Python package manager / tool runner)
|
|
Install-Tool "uv" {
|
|
Invoke-RestMethod https://astral.sh/uv/install.ps1 | Invoke-Expression
|
|
}
|
|
|
|
# 2. just (task runner)
|
|
Install-Tool "just" {
|
|
uv tool install rust-just
|
|
}
|
|
|
|
# 3. Run just setup (installs commitizen, pre-commit, configures git hooks)
|
|
Write-Host ""
|
|
Write-Host "Running just setup..." -ForegroundColor Cyan
|
|
just setup
|
|
|
|
Write-Host ""
|
|
Write-Host "Setup complete!" -ForegroundColor Green
|
|
Write-Host ""
|