Crunz\Console\Command\ConfigGeneratorCommand::execute PHP Method

execute() protected method

Executes the current command
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : null | integer
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return null | integer null or 0 if everything went fine, or an error code
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $filename = getbase() . '/crunz.yml';
        if (file_exists($filename)) {
            $output->writeln('<comment>The configuration file already exists.</comment>');
            exit;
        }
        $src = __DIR__ . '/../../../crunz.yml';
        if (copy($src, $filename)) {
            $output->writeln('<info>The configuration file was generated successfully.</info>');
            exit;
        }
        $output->writeln('<comment>There was a problem when generating the file.</comment>');
        exit;
    }
ConfigGeneratorCommand