mirror of
https://github.com/dancojocaru2000/ai-project-idastar.git
synced 2025-02-22 16:39:35 +02:00
Add OS detection to build script
This commit is contained in:
parent
274c9b0d42
commit
64301e95a6
1 changed files with 12 additions and 1 deletions
|
@ -1,11 +1,22 @@
|
||||||
#! /usr/bin/env pwsh
|
#! /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")
|
$options = @("&Windows", "&Linux")
|
||||||
$choice = $host.UI.PromptForChoice(
|
$choice = $host.UI.PromptForChoice(
|
||||||
"Compile exe",
|
"Compile exe",
|
||||||
"What OS to compile the executable for?",
|
"What OS to compile the executable for?",
|
||||||
$options,
|
$options,
|
||||||
-1
|
$default
|
||||||
)
|
)
|
||||||
|
|
||||||
$platform = $null
|
$platform = $null
|
||||||
|
|
Loading…
Add table
Reference in a new issue