Skip to content

Commit

Permalink
Merge pull request #1850 from mrrobot47/fix/custom-docker-compose-file
Browse files Browse the repository at this point in the history
Extend only valid extension files in custom docker compose
  • Loading branch information
mrrobot47 committed Aug 8, 2024
2 parents f9ef705 + 1d1d8a8 commit a946ec3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions php/class-ee-docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ public static function docker_compose_with_custom( array $files_before_custom =
} else {

if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE_DIR ) ) {
$custom_compose_files = array_diff( scandir( SITE_CUSTOM_DOCKER_COMPOSE_DIR ), [ '.', '..' ] );
$custom_compose_files = array_map( function ( $arrayValues ) {
$ymlFiles = glob( SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/*.yml' );
$yamlFiles = glob( SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/*.yaml' );

return SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $arrayValues;
}, $custom_compose_files );
$custom_compose_files = array_merge( $ymlFiles, $yamlFiles );

$files_before_custom = array_unique( array_merge( $files_before_custom, $custom_compose_files ) );
}
Expand Down

0 comments on commit a946ec3

Please sign in to comment.