Example #1
0
 /**
  * Github create repo command.
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  */
 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>');
 }
Example #2
0
 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  */
 public function askGithubToken(InputInterface $input, OutputInterface $output)
 {
     $question = new ConfirmationQuestion('<info>Do you want to use our assistant to obtain token via Github API (Y/n)? </info>', true);
     if ($this->getHelper('question')->ask($input, $output, $question)) {
         $this->github_token = $this->api->getPersonalToken($this->github_username, $this->askGithubPassword($input, $output));
     }
 }