setName('composer') ->addOption( 'install', 'i', InputOption::VALUE_NONE, 'install the dependencies' ) ->addOption( 'update', 'u', InputOption::VALUE_NONE, 'update the dependencies' ) ->setDescription('Updates the composer vendor dependencies needed by Grav.') ->setHelp('The composer command updates the composer vendor dependencies needed by Grav'); } /** * @return int */ protected function serve(): int { $input = $this->getInput(); $io = $this->getIO(); $action = $input->getOption('install') ? 'install' : ($input->getOption('update') ? 'update' : 'install'); if ($input->getOption('install')) { $action = 'install'; } // Updates composer first $io->writeln("\nInstalling vendor dependencies"); $io->writeln($this->composerUpdate(GRAV_ROOT, $action)); return 0; } }