20 строки
567 B
PowerShell
20 строки
567 B
PowerShell
# script inspired by https://andrewlock.net/simplifying-the-cake-global-tool-bootstrapper-scripts-in-netcore3-with-local-tools/
|
|
|
|
[CmdletBinding()]
|
|
Param(
|
|
[string]$Script = "build.cake",
|
|
[string]$Target,
|
|
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
|
|
[string[]]$ScriptArgs
|
|
)
|
|
|
|
# Restore Cake tool
|
|
& dotnet tool restore
|
|
|
|
# Build Cake arguments
|
|
$cakeArguments = @("$Script");
|
|
if ($Target) { $cakeArguments += "--target=$Target" }
|
|
$cakeArguments += $ScriptArgs
|
|
|
|
& dotnet tool run dotnet-cake -- $cakeArguments
|
|
exit $LASTEXITCODE |