mirror of
https://github.com/kjanat/articulate-parser.git
synced 2026-01-16 11:02:10 +01:00
Implement versioning and build enhancements with cross-platform support
This commit is contained in:
38
scripts/_build_tools_available.ps1
Normal file
38
scripts/_build_tools_available.ps1
Normal file
@ -0,0 +1,38 @@
|
||||
param(
|
||||
[switch]$AsCheckmark
|
||||
)
|
||||
|
||||
# Get the list from 'go tool dist list'
|
||||
$dists = & go tool dist list
|
||||
|
||||
# Parse into OS/ARCH pairs
|
||||
$parsed = $dists | ForEach-Object {
|
||||
$split = $_ -split '/'
|
||||
[PSCustomObject]@{ OS = $split[0]; ARCH = $split[1] }
|
||||
}
|
||||
|
||||
# Find all unique OSes and arches, sorted
|
||||
$oses = $parsed | Select-Object -ExpandProperty OS -Unique | Sort-Object
|
||||
$arches = $parsed | Select-Object -ExpandProperty ARCH -Unique | Sort-Object
|
||||
|
||||
# Group by OS, and build custom objects
|
||||
$results = foreach ($os in $oses) {
|
||||
$props = @{}
|
||||
$props.OS = $os
|
||||
foreach ($arch in $arches) {
|
||||
$hasArch = $parsed | Where-Object { $_.OS -eq $os -and $_.ARCH -eq $arch }
|
||||
if ($hasArch) {
|
||||
if ($AsCheckmark) {
|
||||
$props[$arch] = '✅'
|
||||
} else {
|
||||
$props[$arch] = $true
|
||||
}
|
||||
} else {
|
||||
$props[$arch] = $false
|
||||
}
|
||||
}
|
||||
[PSCustomObject]$props
|
||||
}
|
||||
|
||||
# Output
|
||||
$results | Format-Table -AutoSize
|
||||
Reference in New Issue
Block a user