Script directory for a PowerShell profile. https://blog.lksz.me/keeping-track-of-everything/#-mypsscriptroot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
554 B

  1. [CmdletBinding(SupportsShouldProcess)]param([string[]]$ProjectPath=@($PWD),[switch]$Force)
  2. $local:editCandidates = @('docker-compose.yml','.base.docker-compose.yml')
  3. $local:editFiles = @()
  4. foreach( $local:fileName in $EditCandidates ) {
  5. foreach( $local:path in $ProjectPath ) {
  6. $local:testPath = Join-Path $path $fileName
  7. if( $Force -or $(Test-Path $testPath) ) { $editFiles += $testPath }
  8. }
  9. }
  10. Edit-TextFile $editFiles
  11. $editFiles | Select-Object -First 1 | ForEach-Object { docker-compose --file $(Resolve-Path $_) config -q }