Add switch to Start-PSBuild any specific -Runtime
Much better argument passing to CLI. Thanks @vors.
This commit is contained in:
parent
5671a1113d
commit
e1c0f68098
|
@ -21,7 +21,8 @@ function Start-PSBuild
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
[switch]$Restore,
|
[switch]$Restore,
|
||||||
[string]$Output = "$PSScriptRoot/bin"
|
[string]$Output = "$PSScriptRoot/bin",
|
||||||
|
[string]$Runtime
|
||||||
)
|
)
|
||||||
|
|
||||||
if (-Not (Get-Command "dotnet" -ErrorAction SilentlyContinue)) {
|
if (-Not (Get-Command "dotnet" -ErrorAction SilentlyContinue)) {
|
||||||
|
@ -63,11 +64,15 @@ function Start-PSBuild
|
||||||
|
|
||||||
Write-Host "Building PowerShell"
|
Write-Host "Building PowerShell"
|
||||||
|
|
||||||
$Configuration =
|
$Arguments = "--framework", "netstandardapp1.5", "--output", $Output
|
||||||
if ($IsLinux -Or $IsOSX) { "Linux" }
|
|
||||||
elseif ($IsWindows) { "Debug" }
|
|
||||||
|
|
||||||
dotnet publish -o $Output -c $Configuration -f "netstandardapp1.5" $Top
|
if ($IsLinux -Or $IsOSX) { $Arguments += "--configuration", "Linux" }
|
||||||
|
|
||||||
|
if ($Runtime) { $Arguments += "--runtime", $Runtime }
|
||||||
|
|
||||||
|
$Arguments += $Top
|
||||||
|
|
||||||
|
dotnet publish $Arguments
|
||||||
}
|
}
|
||||||
|
|
||||||
function Start-PSPackage
|
function Start-PSPackage
|
||||||
|
|
Loading…
Reference in a new issue