Skip to content

Commit

Permalink
only remove scan file if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikbosch committed Aug 23, 2024
1 parent 6d27171 commit 5cfb962
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/auradi
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ if ($command === 'scan') {
echo 'Found ' . count($classMapPaths) . ' classmap paths' . PHP_EOL;
echo PHP_EOL;

if (in_array('--force', $args, true)) {
unlink($currentCwd . '/vendor/aura.di.scan.json');
$resultFile = $currentCwd . '/vendor/aura.di.scan.json';
if (in_array('--force', $args, true) && is_file($resultFile)) {
unlink($resultFile);
}

$generator = new CachedFileGenerator(
new ComposerMapGenerator($classMapPaths, $currentCwd),
$currentCwd . '/vendor/aura.di.scan.json',
$resultFile
);

echo 'Scanning paths for classes and annotations.' . PHP_EOL;
Expand Down

0 comments on commit 5cfb962

Please sign in to comment.