Skip to content

Commit

Permalink
Merge pull request #298 from ergebnis/feature/update
Browse files Browse the repository at this point in the history
Enhancement: Simplify update of locker
  • Loading branch information
localheinz authored Dec 26, 2019
2 parents a39a3e5 + 9170f87 commit 3d8b581
Showing 1 changed file with 4 additions and 37 deletions.
41 changes: 4 additions & 37 deletions src/Command/NormalizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,10 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O

$this->resetComposer();

$file = $input->getArgument('file');

if (\is_string($file)) {
return $this->updateLockerInWorkingDirectory(
$output,
\dirname($file)
);
}

return $this->updateLocker($output);
return $this->updateLockerInWorkingDirectory(
$output,
\dirname($composerFile)
);
}

/**
Expand Down Expand Up @@ -374,33 +368,6 @@ private function validateComposerFile(Console\Output\OutputInterface $output, st
);
}

/**
* @see https://getcomposer.org/doc/03-cli.md#update
*
* @param Console\Output\OutputInterface $output
*
* @throws \Exception
*
* @return int
*/
private function updateLocker(Console\Output\OutputInterface $output): int
{
/** @var Console\Application $application */
$application = $this->getApplication();

return $application->run(
new Console\Input\ArrayInput([
'command' => 'update',
'--lock' => true,
'--no-autoloader' => true,
'--no-plugins' => true,
'--no-scripts' => true,
'--no-suggest' => true,
]),
$output
);
}

/**
* @see https://getcomposer.org/doc/03-cli.md#update
*
Expand Down

0 comments on commit 3d8b581

Please sign in to comment.