setName('update-recipe'); $this->setDescription('Invoke this command to update an existing recipe'); $this->addArgument( 'recipe', InputArgument::REQUIRED, 'Recipe name to require inline' ); $this->addArgument( 'version', InputArgument::OPTIONAL, 'Version or constraint to update to' ); $this->addUsage('silverstripe/recipe-blogging'); $this->setHelp( <<getArgument('recipe'); $constraint = $input->getArgument('version'); // Check if this is already installed and notify users $installedVersion = $this->findInstalledVersion($recipe); if (!$installedVersion) { throw new BadMethodCallException( "Recipe {$recipe} is not installed. Please install with require or require-recipe first" ); } // Update recipe return $this->installRecipe($output, $recipe, $constraint, $installedVersion); } }