dco commands will run sequential with single projs

This commit is contained in:
lksz 2021-01-20 22:30:57 -05:00
parent 9dca986b74
commit 0b644b7fdd
1 changed files with 10 additions and 8 deletions

View File

@ -54,7 +54,8 @@ $local:dcPathList = $ProjectPath | ForEach-Object {
}
}
if( -not $dcPathList ) { return }
Write-Verbose "$dcPathList"
$local:SingleProject = $dcPathList.Length -eq 1
foreach( $local:p in $CliParams ) {
if( -not $p ) { continue }
@ -65,8 +66,8 @@ foreach( $local:p in $CliParams ) {
if( $p -isnot [String] -or $p.Length -eq 1 ) {
$local:skipFirst = $true
switch( $p[0] ) {
'&' { $AsJob = $true }
'!' { $Wait = $true }
'&' { $AsJob = -not $SingleProject }
'!' { $Wait = -not $SingleProject }
default { $skipFirst = $false }
}
if( $skipFirst ) { $p = $p | Select-Object -Skip 1 }
@ -92,10 +93,11 @@ foreach( $local:p in $CliParams ) {
if( -not $dcParams ) { continue }
$local:nextActionDescription = "In $dcPath Run $(if($AsJob){"(bg) "})with: $dcParams"
if( $WhatIfPreference ) {
Write-Host "In $dcPath Run $(if($AsJob){"(bg) "})with: $dcParams"
Write-Host -ForegroundColor DarkYellow $nextActionDescription
} else {
Write-Verbose "& docker-compose --file $dcPath $dcParams"
Write-Verbose $nextActionDescription
if( $AsJob ) {
$JobQueue += Start-Job -ArgumentList @($dcPath,$dcParams) -ScriptBlock {