Skip to content

Commit 543f3c9

Browse files
Update cleanup script to be called after npm build
1 parent 5598a2d commit 543f3c9

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

cleanup.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'resources/images/tests.png',
99
'resources/images/login-page.png',
1010
'resources/images',
11-
__FILE__
11+
__FILE__,
1212
];
1313

1414
foreach ($filesToRemove as $file) {
@@ -25,21 +25,21 @@
2525

2626
function removeDirectory(string $dir): bool
2727
{
28-
if (!is_dir($dir)) {
28+
if (! is_dir($dir)) {
2929
return false;
3030
}
3131

3232
$files = array_diff(scandir($dir), ['.', '..']);
33-
33+
3434
foreach ($files as $file) {
35-
$path = $dir . DIRECTORY_SEPARATOR . $file;
36-
35+
$path = $dir.DIRECTORY_SEPARATOR.$file;
36+
3737
if (is_dir($path)) {
3838
removeDirectory($path);
3939
} else {
4040
unlink($path);
4141
}
4242
}
43-
43+
4444
return rmdir($dir);
45-
}
45+
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"@php artisan migrate --graceful --ansi",
6363
"@php artisan db:seed --ansi",
6464
"npm install",
65-
"npm run build"
65+
"npm run build",
66+
"@php cleanup.php"
6667
],
6768
"dev": [
6869
"Composer\\Config::disableProcessTimeout",

0 commit comments

Comments
 (0)