Example #1
0
 /**
  * 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!");
 }