From b9c429ece48ba9d8d3f39ccb7a6f39df8afb420a Mon Sep 17 00:00:00 2001 From: lksz Date: Mon, 18 Jan 2021 19:04:39 -0500 Subject: [PATCH] Fixed Edit-DockerCompose to treat multiple files --- docker/Edit-DockerCompose.ps1 | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docker/Edit-DockerCompose.ps1 b/docker/Edit-DockerCompose.ps1 index 4670800..2d0c2a5 100644 --- a/docker/Edit-DockerCompose.ps1 +++ b/docker/Edit-DockerCompose.ps1 @@ -24,17 +24,22 @@ foreach( $local:ext in @('.yml', '.yaml') ) { $local:testPath = Join-Path $path $fileName if( $Force -or $(Test-Path $testPath) ) { $editFiles += $testPath - $editFiles += Get-ChildItem $(Join-Path $path '*') -Include $EditBonus -Depth 1 + $editFiles += Get-ChildItem $(Join-Path $path '*') -Include $EditBonus -Depth 1 | + Select-Object -ExpandProperty FullName } } } - if( -not $editFiles ) { continue } - - - break + if( $editFiles ) { + break + } } - -Edit-TextFile ($($editFiles | Sort-Object) + $AdditionalFiles) +$local:FinalEditList = $editFiles | Where-Object {$_} | Sort-Object { + $local:n = [System.IO.Path]::GetFileName($_) + Join-Path [PSystem.IO.ath]::GetDirectoryName($_) "$(if( $n[0] -eq '.' ) { "9" } else { "1" })$n" + } +$FinalEditList = @() + $FinalEditList + @() + $AdditionalFiles + +Edit-TextFile $FinalEditList $editFiles | Select-Object -First 1 | ForEach-Object { docker-compose --file $(Resolve-Path $_) config -q }