/** * Create a new project * * @param InputInterface $input * @param OutputInterface $output * @throws Exception */ public function run(InputInterface $input, OutputInterface $output) { // Check if output directory already exists if (Project::isProjectPath($this->directory)) { $this->log($output, "Project already exists in target directory. Skipping project creation", "error"); return; } // Pick and install this version $version = $this->getBestVersion($output); $this->installVersion($output, $version); // Validate result if (!Project::isProjectPath($this->directory)) { throw new Exception("Could not create project"); } // Success $this->log($output, "Project successfully created!"); }
/** * Get command to suggest to publish this release * * @param Version $version * @param Project $project * @return string Command name */ protected function getPublishCommand($version, $project) { $command = 'cow release:publish ' . $version->getValue() . ' ' . $project->getName(); switch ($this->output->getVerbosity()) { case Output::VERBOSITY_DEBUG: $command .= ' -vvv'; break; case Output::VERBOSITY_VERY_VERBOSE: $command .= ' -vv'; break; case Output::VERBOSITY_VERBOSE: $command .= ' -v'; break; } return $command; }