Altax\Command\Builtin\InitCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $configurationPath = getcwd() . "/.altax/config.php";
        if ($input->getOption('global')) {
            $configurationPath = Env::get("homedir") . "/.altax/config.php";
        }
        if (!is_file($configurationPath)) {
            $this->generateConfig($configurationPath, $output);
        } else {
            $output->writeln("<error>File '{$configurationPath}' is already exists. Skiped creation process.</error>");
        }
        $composerFile = dirname($configurationPath) . "/composer.json";
        if (!is_file($composerFile)) {
            $this->generateComposerFile($composerFile, $output);
        } else {
            $output->writeln("<error>File '{$composerFile}' is already exists. Skipped creation process.</error>");
        }
        $gitignoreFile = dirname($configurationPath) . "/.gitignore";
        if (!is_file($gitignoreFile)) {
            $this->generateGitignore($gitignoreFile, $output);
        } else {
            $output->writeln("<error>File '{$gitignoreFile}' is already exists. Skipped creation process.</error>");
        }
    }