forked from servo/servo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmach.ps1
More file actions
32 lines (30 loc) · 1 KB
/
mach.ps1
File metadata and controls
32 lines (30 loc) · 1 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
28
29
30
31
32
$workdir = $PSScriptRoot
$arguments = $args
$expanded = $false
if ($arguments.Count -gt 0) {
$expandedArgs = @()
foreach ($arg in $arguments) {
if ($arg -match '[\*\?\[\]]') {
$expandedItems = Get-Item -Path $arg -ErrorAction SilentlyContinue
if ($expandedItems) {
$expandedArgs += $expandedItems | Select-Object -ExpandProperty FullName
$expanded = $true
} else {
# Expansion fails. Use original arg.
$expandedArgs += $arg
}
} else {
$expandedArgs += $arg
}
}
$arguments = $expandedArgs
if ($expanded){
Write-Host "Expanded arguments: $arguments"
}
}
# UV defaults to x86_64 Python on Arm64, so we need to override that.
# https://github.com/astral-sh/uv/issues/12906
if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') {
$env:UV_PYTHON='arm64'
}
uv run --frozen python (Join-Path $workdir "mach") @arguments