-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmaptoolkit.ps1
More file actions
40 lines (32 loc) · 835 Bytes
/
maptoolkit.ps1
File metadata and controls
40 lines (32 loc) · 835 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$ProjectRoot = $ScriptDir
$UvCmd = if ($IsWindows) { "uv.exe" } else { "uv" }
function Get-Uv {
if (Get-Command $UvCmd -ErrorAction SilentlyContinue) {
return
}
$TempFile = [System.IO.Path]::GetTempFileName() + ".ps1"
try {
Write-Host "Installing uv..."
Invoke-WebRequest -Uri "https://astral.sh/uv/install.ps1" -OutFile $TempFile
& $TempFile
}
finally {
Remove-Item $TempFile -ErrorAction SilentlyContinue
}
}
function Invoke-MapToolkit {
param (
[string[]]$Arguments
)
Get-Uv
Push-Location $ProjectRoot
try {
& uv run python main.py @Arguments
}
finally {
Pop-Location
}
}
Invoke-MapToolkit -Arguments $args