PhpBrew\Command\RemoveCommand::execute PHP Method

execute() public method

public execute ( $buildName )
    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.');
        }
    }