Skip to content

Commit

Permalink
fix(composer): clean composer autoload now works
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed Jul 14, 2020
1 parent 0654a07 commit ed2fed4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions generator/composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ function remove_folder_for_autoload( $composer ) {
if ( isset( $composer[ 'autoload' ] ) ) {
foreach ( $composer[ 'autoload' ][ 'psr-4' ] as $key => $path ) {
$there_is_only_index_file = count_files_in_a_folder( getcwd() . DIRECTORY_SEPARATOR . WPBP_PLUGIN_SLUG . '/' . $path );
if ( $there_is_only_index_file === 1 ) {
if ( $there_is_only_index_file === 1 || $there_is_only_index_file === 0 ) {
unset( $composer[ 'autoload' ][ 'psr-4' ][ $key ] );
print_v( 'Removed ' . $key . ' from composer' );
}
}
$composer[ 'autoload' ][ 'psr-4' ] = $composer[ 'autoload' ][ 'psr-4' ];
}

return $composer;
Expand Down
1 change: 1 addition & 0 deletions generator/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
remove_empty_folders();
// Another round to remove the folder that wasn't cleaned at first round
remove_empty_folders();
execute_composer();
$clio->styleLine( 'Done, I am superfast!', $info );
$clio->styleLine( '', $info );
$clio->styleLine( '👉 Don\'t forget to look on https://wpbp.github.io/wiki.html', $info );
Expand Down
1 change: 0 additions & 1 deletion generator/wpbp.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ function execute_generator( $config ) {
git_init();
grunt();
grumphp();
execute_composer();
}

function parse_conditional_template( $file, $config, $file_content ) {
Expand Down

0 comments on commit ed2fed4

Please sign in to comment.