Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Adding file_exists() check to composer munge command. #1030

Merged
merged 1 commit into from
Feb 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Console/Command/ComposerMungeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ protected function configure() {
protected function execute(InputInterface $input, OutputInterface $output) {
$file1 = $input->getArgument('file1');
$file2 = $input->getArgument('file2');

if (!file_exists($file1)) {
throw new \Exception("The file $file1 does not exist");
}
if (!file_exists($file2)) {
throw new \Exception("The file $file2 does not exist");
}

$munged_json = $this->munge($file1, $file2);

$output->writeln($munged_json);
Expand Down