diff --git a/bin/build-release.sh b/bin/build-release.sh
index 6be662065514d13657e930aafe80087bbeb4a8d5..247280817653ff1f71a12dcede7ec8fba9f87266 100755
--- a/bin/build-release.sh
+++ b/bin/build-release.sh
@@ -61,10 +61,10 @@ rm "$TARGET/www/assets/js/stylesheet.js"*
 rm "$TARGET/.editorconfig"
 rm "$TARGET/.gitattributes"
 rm -r "$TARGET/.github"
-rm "$TARGET"/{,modules}/.php_cs.dist
-rm "$TARGET"/{,modules}/codecov.yml
-rm "$TARGET"/{,modules}/psalm.xml
-rm "$TARGET"/{,modules}/.gitignore
+rm "$TARGET"/{,modules/*}/.php_cs.dist
+rm "$TARGET"/{,modules/*}/codecov.yml
+rm "$TARGET"/{,modules/*}/psalm.xml
+rm "$TARGET"/{,modules/*}/.gitignore
 rm "$TARGET"/{cache,config,metadata,locales}/.gitkeep
 rm "$TARGET/composer.phar"
 tar --owner 0 --group 0 -cvzf "$TARGET.tar.gz" "$TARGET"