Files
dimma/scripts/run.ps1
T

27 lines
932 B
PowerShell

# Run script for Dimma (PowerShell)
# Usage: .\run.ps1 [platform] [arch]
# Platform can be: linux, windows, darwin
# Default: auto-detects current platform
$PROJECT_DIR = Resolve-Path (Split-Path $PSScriptRoot -Parent)
$BUILD_DIR = "$PROJECT_DIR\build"
$PLATFORM = if ($args.Count -gt 0) { $args[0] } else { $env:GOOS }
$ARCH = if ($args.Count -gt 1) { $args[1] } else { $env:GOARCH }
if ($PLATFORM -eq "") { $PLATFORM = $IsWindows -as [string] ? "windows" : ($IsLinux -as [string] ? "linux" : "darwin") }
if ($ARCH -eq "") { $ARCH = $env:PROCESSOR_ARCHITEW6432 -replace "AMD64", "amd64" -replace "ARM64", "arm64" }
$BINARY = "$BUILD_DIR\dimma-$PLATFORM-$ARCH"
if ($PLATFORM -eq "windows") { $BINARY = "$BINARY.exe" }
if (-not (Test-Path $BINARY)) {
Write-Host "Binary not found: $BINARY"
Write-Host "Available binaries in $BUILD_DIR:"
Get-ChildItem $BUILD_DIR
exit 1
}
Write-Host "Running: $BINARY"
& $BINARY