You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
586 B
31 lines
586 B
#! /usr/bin/env pwsh |
|
|
|
$options = @("&Windows", "&Linux") |
|
$choice = $host.UI.PromptForChoice( |
|
"Compile exe", |
|
"What OS to compile the executable for?", |
|
$options, |
|
-1 |
|
) |
|
|
|
$platform = $null |
|
switch ($choice) { |
|
0 { $platform = "win-x64" } |
|
1 { $platform = "linux-x64" } |
|
Default { |
|
Write-Host "No OS chosen, exiting." |
|
Exit |
|
} |
|
} |
|
|
|
$sc = $null |
|
switch ($host.UI.PromptForChoice( |
|
"Self Contained", |
|
"Should the executable be runnable without installing .NET Runtime?", |
|
@("&Yes", "&No"), |
|
0)) { |
|
0 { $sc = "true" } |
|
1 { $sc = "false" } |
|
} |
|
|
|
dotnet publish -r $platform --self-contained $sc
|
|
|