Fixed Edit-DockerCompose to treat multiple files
This commit is contained in:
parent
1b62fd1114
commit
b9c429ece4
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
$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 ($($editFiles | Sort-Object) + $AdditionalFiles)
|
||||
Edit-TextFile $FinalEditList
|
||||
|
||||
$editFiles | Select-Object -First 1 | ForEach-Object { docker-compose --file $(Resolve-Path $_) config -q }
|
||||
|
|
Loading…
Reference in New Issue