diff --git a/src/Commands/ArtifactCommand.php b/src/Commands/ArtifactCommand.php index 1815529..8bc46d5 100644 --- a/src/Commands/ArtifactCommand.php +++ b/src/Commands/ArtifactCommand.php @@ -237,11 +237,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->checkRequirements(); // @phpstan-ignore-next-line $this->processArtifact($remote, $input->getOptions()); + // Dump log file and clean tmp log file. - if (!empty($this->logFile)) { - $this->fsFileSystem->copy($tmpLogFile, $this->logFile); + if ($this->fsFileSystem->exists($tmpLogFile)) { + if (!empty($this->logFile)) { + $this->fsFileSystem->copy($tmpLogFile, $this->logFile); + } + $this->fsFileSystem->remove($tmpLogFile); } - $this->fsFileSystem->remove($tmpLogFile); } catch (\Exception $exception) { $this->output->writeln([