diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 658d58de3..4a8a47559 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -349,6 +349,10 @@ EOT } throw $e; } finally { + if ($input->getOption('dry-run') && $this->newlyCreated) { + @unlink($this->json->getPath()); + } + $signalHandler->unregister(); } }