Skip to content

Commit

Permalink
Extend only valid extension files
Browse files Browse the repository at this point in the history
Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com>
  • Loading branch information
mrrobot47 committed Aug 8, 2024
1 parent f9ef705 commit 1d1d8a8
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 1d1d8a8

Please sign in to comment.