Пример #1
0
 public function execute($buildName)
 {
     $prefix = Config::getVersionInstallPrefix($buildName);
     if (!file_exists($prefix)) {
         throw new Exception("{$prefix} does not exist.");
     }
     $prompter = new \CLIFramework\Prompter();
     $answer = $prompter->ask("Are you sure to delete {$buildName}?", array('Y', 'n'), 'Y');
     if (strtolower($answer) == "y") {
         Utils::recursive_unlink($prefix, $this->logger);
         $this->logger->info("{$buildName} is removed.  I hope you're not surprised. :)");
     } else {
         $this->logger->info("Let me guess, you drunk tonight.");
     }
 }
Пример #2
0
 public function execute($version)
 {
     $buildDir = Config::getBuildDir() . DIRECTORY_SEPARATOR . $version;
     if ($this->options->all) {
         if (!file_exists($buildDir)) {
             $this->logger->info("Source directory " . $buildDir . " does not exist.");
         } else {
             $this->logger->info("Source directory " . $buildDir . " found, deleting...");
             Utils::recursive_unlink($buildDir, $this->logger);
         }
     } else {
         $make = new MakeTask($this->logger);
         $make->setQuiet();
         $build = new Build($version);
         $build->setSourceDirectory($buildDir);
         if ($make->clean($build)) {
             $this->logger->info("Distribution is cleaned up. Woof! ");
         }
     }
 }