Github create repo command.

@param InputInterface $input
@param OutputInterface $output
328341
public function githubCreateRepo(InputInterface $input, OutputInterface $output)
    {
        $this->api->setCredentials($this->getCredentials($output));
        $name = $this->repoName($input);
        try {
            $this->api->createRepo($name,$this->repoDescription($input));
        } catch (ServerException $se) {
            //TODO
            $output->writeln('<error>Server exception thrown</error>');
            die();
        } catch (ClientException $ce) {
            $this->showError( $ce , $output );
        }
        $output->writeln('<info>Repository ' . $name . ' created</info>');
    }
1341261
protected function runCommand(InputInterface $input, OutputInterface $output)
    {
        $this->getRepositoryAndIndices($input, $output);

        $this
            ->repositoryBucket->findRepository($input->getArgument('app-name'))
            ->deleteToken(
                TokenUUID::createById($input->getArgument('uuid'))
            );
    }
983759
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setIo($input, $output);

        $repo = $this->prepareRepository();

        $this->rebuild();

        $this->deployWithGit($repo);
    }
129100
protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var $repository Repository */
        $repository = $this->getContainer()->get('ezpublish.api.repository');

        /** @var $questionHelper QuestionHelper */
        $questionHelper = $this->getHelper('question');

        $question = new Question('Content type group name: ');
        $question->setValidator(
            array(
                'Smile\EzToolsBundle\Command\ContentTypeGroup\Validators',
                'validateContentTypeGroupName'
            )
        );

        $contentTypeGroupName = false;
        while(!$contentTypeGroupName) {
            $contentTypeGroupName = $questionHelper->ask($input, $output, $question);

            if (!$contentTypeGroupName || empty($contentTypeGroupName)) {
                $output->writeln("<error>Content type group name should only contains numbers, letters or space</error>");
            }
        }

        /** @var $configResolver ConfigResolver */
        $configResolver = $this->getContainer()->get('ezpublish.config.resolver');
        $adminID = $configResolver->getParameter('adminid', 'smile_ez_tools');

        $contentTypeGroupService = new ContentTypeGroup($repository);
        $contentTypeGroupService->setAdminID($adminID);
        try {
            $contentTypeGroupService->add($contentTypeGroupName);
            $output->writeln( "<info>Content type group created '$contentTypeGroupName'<info>");
        } catch( UnauthorizedException $e) {
            $output->writeln( "<error>" . $e->getMessage() . "</error>" );
        } catch (ForbiddenException $e ) {
            $output->writeln( "<error>" . $e->getMessage() . "</error>" );
        }
    }
419662
public function execute(InputInterface $input, OutputInterface $output)
    {
        $argument = $input->getArgument($this->argumentName);
        $path = $this->basePath.'/'.$argument.'.php';

        if ($input->hasOption('restful') && $input->getOption('restful') == true) {
            $this->restful = true;
        } else {
            $this->restful = false;
        }

        $response = $this->runFileGeneratorCommand($path, $argument);

        if ($response === true) {
            $this->type ?: $this->type = 'Command';
            $output->writeln(ucfirst($this->type).' created successfully');

            return;
        }
        $output->writeln($response);
    }
1203946
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;

        /** @var $repository Repository */
        $repository = $this->getContainer()->get('ezpublish.api.repository');

        /** @var $contentService ContentService */
        $contentService = $repository->getContentService();
        /** @var $contentTypeService ContentTypeService*/
        $contentTypeService = $repository->getContentTypeService();
        /** @var $locationService LocationService */
        $locationService = $repository->getLocationService();

        /** @var $questionHelper QuestionHelper */
        $questionHelper = $this->getHelper('question');

        $struct = array();

        $struct['parentLocationID'] = $this->getParentLocationID($locationService, $questionHelper);
        $struct['contentTypeIdentifier'] = $this->getContentTypeIdentifier($contentTypeService, $questionHelper);
        $contentType = $contentTypeService->loadContentTypeByIdentifier($struct['contentTypeIdentifier']);
        $languageCode = $contentType->mainLanguageCode;
        $struct['languageCode'] = $languageCode;

        $struct['fields'] = array();
        $fields = $contentType->getFieldDefinitions();
        foreach ($fields as $field) {
            $fieldName = $field->getName($languageCode);
            $fieldIdentifier = $field->identifier;

            $fieldValue = $this->getFieldValue($questionHelper, $fieldName);
            $struct['fields'][] = array(
                'identifier' => $fieldIdentifier,
                'value' => $fieldValue
            );
        }

        /** @var $configResolver ConfigResolver */
        $configResolver = $this->getContainer()->get('ezpublish.config.resolver');
        $adminID = $this->getContainer()->getParameter('smile_ez_tools.adminid');

        $smileEzContentService = new Content($repository);
        $smileEzContentService->setAdminID($adminID);
        try {
            $smileEzContentService->add($struct);
            $output->writeln("<info>Content created</info>");
        } catch (UnauthorizedException $e) {
            $output->writeln("<error>" . $e->getMessage() . "</error>");
        } catch (ForbiddenException $e ) {
            $output->writeln("<error>" . $e->getMessage() . "</error>");
        }
    }
261780
public function getRepoURL(InputInterface $input, OutputInterface $output)
    {
        return 'git@github.com:' . $this->gitHubUsername($input,$output) . '/' . $this->repoName($input) . '.git';
    }
764787
private function cloneRepo($repo, $cloneUrl, $newRepoHome, $upstreamUsername)
    {
        $this->outputSuccess("{$repo}: cloning {$cloneUrl} ...");
        $this->getGitWrapper()->cloneRepository($cloneUrl, $newRepoHome);
        
        if (!empty($upstreamUsername)) {
            $this->getGitWrapper()->git('remote add upstream https://github.com/'.$upstreamUsername.'/'.$repo.'.git', $newRepoHome);
            $this->outputInfo("{$repo}: Configure upstream https://github.com/{$upstreamUsername}/{$repo}.git ✔");
        }
        
        $this->outputSuccess("{$repo}: cloning ✔");
    }
778769
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $bugId = $input->getArgument('bug-id');
        $reducer = $input->getArgument('reducer');
        $length = $input->getArgument('length');
        $from = $input->getArgument('from');
        $to = $input->getArgument('to');

        $this->setAnonymousToken();

        $pathReducer = $this->pathReducerManager->getPathReducer($reducer);
        $pathReducer->handle($bugId, $length, $from, $to);
    }
557886
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;

        if (null === ($backupDir = $input->getArgument('backup-dir'))) {
            $backupDir = $this->doAskBackupDir();
        }

        if (null === ($machine = $input->getOption('machine'))) {
            $machine = $this->doAskMachineName();
        }

        if (null === ($installDir = $input->getOption('install-dir'))) {
            $installDir = $this->doAskInstallDir();
        }

        $this->initDotfilesProfile($backupDir, $machine, $installDir);
    }
514558
public function doRun(InputInterface $input, OutputInterface $output)
    {
        if (!$input->hasParameterOption('--quiet')) {
            $output->write(
                sprintf(
                    "phpjunitmerge %s by Andreas Weber\n\n",
                    $this->getVersion()
                )
            );
        }

        if ($input->hasParameterOption('--version')
            || $input->hasParameterOption('-V')
        ) {
            exit;
        }

        if (!$input->getFirstArgument()) {
            $input = new ArrayInput(array('--help'));
        }

        parent::doRun($input, $output);
    }
772518
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $error = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;

        if (!($input->getOption('php-files')
            || $input->getOption('composer')
            || $input->getOption('bower')
            || $input->getOption('packages'))
        ) {
            $error->writeln('<error>You must select at least one validation to run!</error>');
            $error->writeln('check-author.php [--php-files] [--composer] [--bower] [--packages]');

            return 1;
        }

        $this->enableDeprecatedNoProgressBar($input);

        $config = new Config();

        if (!$input->getOption('do-not-ignore-well-known-bots')) {
            $configFile = \dirname(\dirname(__DIR__))
                . DIRECTORY_SEPARATOR . 'defaults'
                . DIRECTORY_SEPARATOR . 'ignore-well-known-bots.yml';
            $config->addFromYml($configFile);
        }

        $configFile = $input->getOption('config');
        if (\is_file($configFile)) {
            $config->addFromYml($configFile);
        }

        $config
            ->ignoreAuthors($input->getOption('ignore'))
            ->excludePaths($input->getOption('exclude'))
            ->includePaths(
                \array_filter(\array_map('realpath', $input->getArgument('include')))
            );

        $paths = \array_values($config->getIncludedPaths());
        $git   = new GitRepository($this->determineGitRoot($paths[0]));
        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) {
            $git->getConfig()->setLogger(
                new ConsoleLogger($output)
            );
        }

        $cacheDir = \rtrim((($tmpDir = ('\\' === PATH_SEPARATOR
            ? \getenv('HOMEDRIVE') . \getenv('HOMEPATH')
            : \getenv('HOME'))) ? $tmpDir : \sys_get_temp_dir()), '\\/');
        if ($input->getOption('cache-dir')) {
            $cacheDir = \rtrim($input->getOption('cache-dir'), '/');
        }
        $cacheDir .= '/.cache/phpcq-author-validation';

        if ($output->isVerbose()) {
            $error->writeln(\sprintf('<info>The folder "%s" is used as cache directory.</info>', $cacheDir));
        }

        $cachePool = new DoctrineCachePool(
            $input->getOption('no-cache')
                ? new VoidCache()
                : new FilesystemCache($cacheDir)
        );

        $diff         = $input->getOption('diff');
        $extractors   = $this->createSourceExtractors($input, $error, $config, $cachePool);
        $gitExtractor = $this->createGitAuthorExtractor($input->getOption('scope'), $config, $error, $cachePool, $git);
        $progressBar  = !$output->isQuiet() && !$input->getOption('no-progress') && \posix_isatty(STDOUT);
        $comparator   = new AuthorListComparator($config, $error, $progressBar);
        $comparator->shallGeneratePatches($diff);

        $failed = $this->handleExtractors($extractors, $gitExtractor, $comparator);

        if ($failed && $diff) {
            $output->writeln($comparator->getPatchSet());
        }

        return $failed ? 1 : 0;
    }
182651
protected function setDeployOptions(InputInterface $input, OutputInterface $output)
    {
        $project = ProjectX::getProjectType();

        if ($project instanceof DeployAwareInterface) {
            $command_io = new SymfonyStyle($input, $output);
            $command_io->title('Deploy Build Options');

            $form = (new Form())
                ->setInput($input)
                ->setOutput($output)
                ->setHelperSet($this->getHelperSet())
                ->addFields([
                    (new BooleanField('deploy', 'Setup build deploy?'))
                        ->setDefault(false)
                        ->setSubform(function ($subform, $value) {
                            if (true === $value) {
                                $subform->addFields([
                                    (new TextField('repo_url', 'Repository URL')),
                                ]);
                            }
                        })
                ])
                ->process();

            $results = $form->getResults();

            if (isset($results['deploy']) && !empty($results['deploy'])) {
                $this->options['deploy'] = $results['deploy'];
            }
        }

        return $this;
    }
863939
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $persistence = $this->getPersistence();
        $output->writeln(sprintf(
            'Pulling translations in %s',
            $persistence->getDirectoryName()
        ));

        $gitOutput = $persistence->pullTranslations();
        $output->writeln($gitOutput);

        $output->writeln('Done.');
    }
192705
protected function execute(InputInterface $input, OutputInterface $output)
    {
        // Get the current version or generate a new one if the user has confirm that this is required
        try {
            $currentVersion = Context::get('version-persister')->getCurrentVersion();
        } catch (\Liip\RMT\Exception\NoReleaseFoundException $e) {
            if (Context::get('information-collector')->getValueFor('confirm-first') == false) {
                throw $e;
            }
            $currentVersion = Context::get('version-generator')->getInitialVersion();
        }
        Context::getInstance()->setParameter('current-version', $currentVersion);

        // Generate and save the new version number
        $newVersion = Context::get('version-generator')->generateNextVersion(
            Context::getParam('current-version')
        );
        Context::getInstance()->setParameter('new-version', $newVersion);

        $this->executeActionListIfExist('pre-release-actions');

        $this->getOutput()->writeSmallTitle('Release process');
        $this->getOutput()->indent();

        $this->getOutput()->writeln("A new version named [<yellow>$newVersion</yellow>] is going to be released");
        Context::get('version-persister')->save($newVersion);
        $this->getOutput()->writeln('Release: <green>Success</green>');

        $this->getOutput()->unIndent();

        $this->executeActionListIfExist('post-release-actions');
    }
243611
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;
        $configurationPath = $input->getOption('configurationPath');
        $deploymentName = $input->getArgument('deploymentName');
        $deployment = $this->factory->getDeployment($deploymentName, $configurationPath);
        $workflow = $deployment->getWorkflow();

        if (! $deployment instanceof FailedDeployment) {
            $output->writeln('<success>Deployment ' . $deployment->getName() . '</success>');
            $output->writeln('');
            $output->writeln('Workflow: <success>' . $workflow->getName() . '</success>');

            if ($workflow instanceof SimpleWorkflow) {
                $value = $workflow->isEnableRollback() ? 'true' : 'false';
                $output->writeln('    <comment>Rollback enabled:</comment> <info>' . $value . '</info>');
            }

            $output->writeln('');

            $this->printNodes($deployment->getNodes());

            $this->printApplications($deployment->getApplications(), $deployment->getWorkflow());
        }
    }
660989
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $iterationCount = (int)$input->getOption('iteration-count');

        $locationsCount = $this->repository->sudo(
            function (Repository $repository) {
                return $repository->getLocationService()->getAllLocationsCount();
            }
        );

        $helper = $this->getHelper('question');
        $question = new ConfirmationQuestion(
            sprintf(
                "<info>Found %d Locations.</info>\n%s\n<info>Do you want to proceed? [y/N] </info>",
                $locationsCount,
                self::BEFORE_RUNNING_HINTS
            ),
            false
        );
        if (!$helper->ask($input, $output, $question)) {
            return;
        }

        $output->writeln('Regenerating System URL aliases...');

        $progressBar = $this->getProgressBar($locationsCount, $output);
        $progressBar->start();

        for ($offset = 0; $offset <= $locationsCount; $offset += $iterationCount) {
            gc_disable();
            $locations = $this->repository->sudo(
                function (Repository $repository) use ($offset, $iterationCount) {
                    return $repository->getLocationService()->loadAllLocations($offset, $iterationCount);
                }
            );
            $this->processLocations($locations, $progressBar);
            gc_enable();
        }
        $progressBar->finish();
        $output->writeln('');
        $output->writeln('<info>Done.</info>');

        $output->writeln('<info>Cleaning up corrupted URL aliases...</info>');
        $corruptedAliasesCount = $this->repository->sudo(
            function (Repository $repository) {
                return $repository->getURLAliasService()->deleteCorruptedUrlAliases();
            }
        );
        $output->writeln("<info>Done. Deleted {$corruptedAliasesCount} entries.</info>");
        $output->writeln('<comment>Make sure to clear HTTP cache afterwards.</comment>');
    }