File tree Expand file tree Collapse file tree 2 files changed +32
-6
lines changed
Expand file tree Collapse file tree 2 files changed +32
-6
lines changed Original file line number Diff line number Diff line change 99 "test" : " bash tests/tests.sh" ,
1010 "post-install-cmd" : [
1111 " @composer install --working-dir ./tools/autoupdate/" ,
12- " @php -r \" array_map('unlink', glob('vendor/enshrined/svg-sanitize/tests/data/*.svg'));\" " ,
13- " @php -r \" array_map('unlink', glob('vendor/stefangabos/zebra_image/examples/images/*'));\" " ,
14- " @php -r \" if (is_dir('vendor/stefangabos/zebra_image/examples/images/')){rmdir('vendor/stefangabos/zebra_image/examples/images/');}\" " ,
15- " @php -r \" array_map('unlink', glob('vendor/stefangabos/zebra_image/examples/*'));\" " ,
16- " @php -r \" if (is_dir('vendor/stefangabos/zebra_image/examples')){rmdir('vendor/stefangabos/zebra_image/examples');}\" "
12+ " YesWiki\\ Core\\ ComposerScriptsHelper::postInstall"
1713 ],
1814 "post-update-cmd" : [
19- " @composer update --working-dir ./tools/autoupdate/"
15+ " @composer update --working-dir ./tools/autoupdate/" ,
16+ " YesWiki\\ Core\\ ComposerScriptsHelper::postInstall"
2017 ]
2118 },
2219 "require" : {
7976 },
8077 "platform-check" : true ,
8178 "sort-packages" : true
79+ },
80+ "autoload-dev" : {
81+ "classmap" : [" includes/ComposerScriptsHelper.php" ]
8282 }
8383}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace YesWiki \Core ;
4+
5+ use Composer \Script \Event ;
6+
7+ class ComposerScriptsHelper
8+ {
9+ public static function postInstall (Event $ event )
10+ {
11+ // clean test files from svg-sanitize
12+ echo "clean test files from svg-sanitize \n" ;
13+ array_map ('unlink ' , glob ('vendor/enshrined/svg-sanitize/tests/data/*.svg ' ));
14+
15+ // clean example files from zebra_image
16+ echo "clean example files from zebra_image \n" ;
17+ array_map ('unlink ' , glob ('vendor/stefangabos/zebra_image/examples/images/* ' ));
18+ if (is_dir ('vendor/stefangabos/zebra_image/examples/images/ ' )) {
19+ rmdir ('vendor/stefangabos/zebra_image/examples/images/ ' );
20+ }
21+ array_map ('unlink ' , glob ('vendor/stefangabos/zebra_image/examples/* ' ));
22+ if (is_dir ('vendor/stefangabos/zebra_image/examples ' )) {
23+ rmdir ('vendor/stefangabos/zebra_image/examples ' );
24+ }
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments