Skip to content

Commit

Permalink
Ensure composer.json gets deleted after a dry run require, fixes #11747
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Dec 19, 2023
1 parent 83f831b commit 3cfd9bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Composer/Command/RequireCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
throw $e;
} finally {
if ($input->getOption('dry-run') && $this->newlyCreated) {
@unlink($this->json->getPath());
}

$signalHandler->unregister();
}
}
Expand Down

0 comments on commit 3cfd9bf

Please sign in to comment.