diff --git a/app/Console/Commands/ClearBuild.php b/app/Console/Commands/ClearBuild.php new file mode 100644 index 0000000..3f0fed0 --- /dev/null +++ b/app/Console/Commands/ClearBuild.php @@ -0,0 +1,51 @@ +file); + } + + $count = 0; + foreach (File::files(public_path('build/assets')) as $file) { + if (! in_array($file->getFilename(), $filesUsed)) { + unlink($file->getPathname()); + $count++; + } + } + + $this->info($count.' files deleted.'); + } catch (Exception $e) { + $this->error($e->getMessage()); + } + } +}