Repository navigation
Expand file tree
/
Copy pathinstall-dev.ps1
More file actions
27 lines (25 loc) · 1.48 KB
/
Copy pathinstall-dev.ps1
File metadata and controls
27 lines (25 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
param(
[string]$BackendPath = (Join-Path $PSScriptRoot "..\MoDiff"),
[ValidateSet("auto", "nvidia", "amd", "intel", "mps", "cpu")][string]$Accelerator = "auto",
[switch]$AllowExperimental, [switch]$Resume, [switch]$Repair
)
$ErrorActionPreference = "Stop"
$installer = Join-Path $BackendPath "install.ps1"
if (!(Test-Path $installer)) { throw "MoDiff backend installer not found at $installer" }
& $installer -Accelerator $Accelerator -AllowExperimental:$AllowExperimental -Resume:$Resume -Repair:$Repair -BackendOnly
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$python = Join-Path $BackendPath ".venv\Scripts\python.exe"
$testRequirements = Join-Path $BackendPath "requirements\test.txt"
$uvRoot = Join-Path $BackendPath ".modiff\tools\uv"
$uv = Get-ChildItem $uvRoot -Filter uv.exe -File -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
if (!$uv) { throw "MoDiff's verified uv executable was not found under $uvRoot" }
& $uv.FullName pip install --python $python -r $testRequirements
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Set-Location $PSScriptRoot
& npm.cmd ci
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$artifactDir = Join-Path $PSScriptRoot "artifacts\dev-install-current"
New-Item -ItemType Directory -Force -Path $artifactDir | Out-Null
& $python -m modiff.preflight --json --fail-on-error | Set-Content (Join-Path $artifactDir "backend-preflight.json")
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host "Development environment is ready. Run .\run-dev.ps1."