diff --git a/src/GenerateArchivedRecipesCommand.php b/src/GenerateArchivedRecipesCommand.php index 625da3a..d084736 100644 --- a/src/GenerateArchivedRecipesCommand.php +++ b/src/GenerateArchivedRecipesCommand.php @@ -50,6 +50,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $process->mustRun(); $tmpDir = sys_get_temp_dir().'/_flex_archive/'; + if (file_exists($tmpDir)) { + $filesystem->remove($tmpDir); + } $filesystem->mkdir($tmpDir); $process = (new Process(['git', 'rev-list', '--count', $branch, '--no-merges'], $recipesDirectory))->mustRun(); diff --git a/src/GenerateFlexEndpointCommand.php b/src/GenerateFlexEndpointCommand.php index 84be3c7..c5cb078 100644 --- a/src/GenerateFlexEndpointCommand.php +++ b/src/GenerateFlexEndpointCommand.php @@ -153,7 +153,7 @@ private function generatePackageJson(string $package, string $version, array $ma file_put_contents(sprintf('%s/%s.%s.json', $outputDir, str_replace('/', '.', $package), $version), $contents); // save another version for the archives - $archivedPath = sprintf('%s/archived/%s.%s/%s.json', $outputDir, str_replace('/', '.', $package), $version, $tree); + $archivedPath = sprintf('%s/archived/%s/%s.json', $outputDir, str_replace('/', '.', $package), $tree); if (!file_exists(\dirname($archivedPath))) { mkdir(\dirname($archivedPath), 0777, true); }