From 64301e95a6cc9e7bc1396b25aa00074b05e29632 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Mon, 6 Dec 2021 16:27:05 +0200 Subject: [PATCH] Add OS detection to build script --- build-exe.ps1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build-exe.ps1 b/build-exe.ps1 index 6025f46..7903a7d 100755 --- a/build-exe.ps1 +++ b/build-exe.ps1 @@ -1,11 +1,22 @@ #! /usr/bin/env pwsh +$platform = [System.Environment]::OSVersion.platform +if ($platform -eq 4) { + $default = 1 +} +elseif ($platform -le 2) { + $default = 0 +} +else { + $default = -1 +} + $options = @("&Windows", "&Linux") $choice = $host.UI.PromptForChoice( "Compile exe", "What OS to compile the executable for?", $options, - -1 + $default ) $platform = $null