File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,30 @@ $Arguments = @{
4343 exclusive = $Exclusive ;
4444 nuget_useinprocessclient = $true ;
4545}.GetEnumerator() | ForEach-Object {
46- if ($_.value -ne " " ) { " --{0}=`" {1}`" " -f $_.key , $_.value }
46+ if ($ ($_.Key -ceq " dryrun" ) -or ($_.Key -ceq " exclusive" )) {
47+ if ($_.Value -eq $true ) {
48+ # switches must not be assigned true or false, but must be passed to indicate true.
49+ " --{0}" -f $_.Key
50+ }
51+ }
52+ else {
53+ if ($_.Value -cne " " ) {
54+ if ($_.Value -as [string ] -contains " " ) {
55+ $_.Value = " $ ( $_.Value ) " # if it contains spaces, enclose it.
56+ }
57+ " --{0}={1}" -f $_.Key , $_.Value
58+ }
59+ }
4760};
4861
62+ $Arguments | Join-String - Separator " " | Write-Verbose
63+
4964# Start Cake
5065Write-Host " Running build stage $Stage ..."
5166
52- & dotnet run -- project build/ $Stage / $Stage.csproj -- $Arguments $ScriptArgs
67+ $cmdline = " & dotnet run --project build/$Stage /$Stage .csproj -- $Arguments $ScriptArgs "
68+ Write-Verbose $cmdline
69+ Invoke-Command - ScriptBlock ([scriptblock ]::Create($cmdline ))
5370
5471if ($env: APPVEYOR ) {
5572 $host.SetShouldExit ($LASTEXITCODE )
You can’t perform that action at this time.
0 commit comments