Added support to Dockerfile and env in dcedit
This commit is contained in:
parent
b8c343d908
commit
c552452ac4
|
@ -14,14 +14,26 @@
|
|||
|
||||
)
|
||||
|
||||
$local:editCandidates = @('docker-compose.yml','.base.docker-compose.yml','Dockerfile')
|
||||
$local:EditCandidates = @('docker-compose.###','.base.docker-compose.###')
|
||||
$local:EditBonus = @('Dockerfile', '.env', '*.env')
|
||||
$local:editFiles = @()
|
||||
foreach( $local:fileName in $EditCandidates ) {
|
||||
foreach( $local:ext in @('.yml', '.yaml') ) {
|
||||
$local:rawEditCandidates = $EditCandidates | ForEach-Object { $_ -replace '\.###',$ext }
|
||||
foreach( $local:fileName in $rawEditCandidates ) {
|
||||
foreach( $local:path in $ProjectPath ) {
|
||||
$local:testPath = Join-Path $path $fileName
|
||||
if( $Force -or $(Test-Path $testPath) ) { $editFiles += $testPath }
|
||||
if( $Force -or $(Test-Path $testPath) ) {
|
||||
$editFiles += $testPath
|
||||
$editFiles += Get-ChildItem $(Join-Path $path '*') -Include $EditBonus -Depth 1
|
||||
}
|
||||
}
|
||||
}
|
||||
if( -not $editFiles ) { continue }
|
||||
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Edit-TextFile ($($editFiles | Sort-Object) + $AdditionalFiles)
|
||||
|
||||
|
|
Loading…
Reference in New Issue