2020-11-04 15:58:04 +00:00
|
|
|
[CmdletBinding(SupportsShouldProcess)]param([string[]]$ProjectPath=@($PWD),[switch]$Force)
|
2020-10-31 21:10:32 +00:00
|
|
|
|
|
|
|
$local:editCandidates = @('docker-compose.yml','.base.docker-compose.yml')
|
|
|
|
$local:editFiles = @()
|
|
|
|
foreach( $local:fileName in $EditCandidates ) {
|
|
|
|
foreach( $local:path in $ProjectPath ) {
|
|
|
|
$local:testPath = Join-Path $path $fileName
|
2020-11-04 15:58:04 +00:00
|
|
|
if( $Force -or $(Test-Path $testPath) ) { $editFiles += $testPath }
|
2020-10-31 21:10:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Edit-TextFile $editFiles
|
|
|
|
|
2020-11-04 15:58:04 +00:00
|
|
|
$editFiles | Select-Object -First 1 | ForEach-Object { docker-compose --file $(Resolve-Path $_) config -q }
|