summaryrefslogtreecommitdiffstats
path: root/src/GitHubPagesDeploy/Console/Command/DeployCommand.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/GitHubPagesDeploy/Console/Command/DeployCommand.php')
-rw-r--r--src/GitHubPagesDeploy/Console/Command/DeployCommand.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/GitHubPagesDeploy/Console/Command/DeployCommand.php b/src/GitHubPagesDeploy/Console/Command/DeployCommand.php
new file mode 100644
index 0000000..70c7d8a
--- /dev/null
+++ b/src/GitHubPagesDeploy/Console/Command/DeployCommand.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace GitHubPagesDeploy\Console\Command;
+
+use GitHubPagesDeploy\GitHubPagesDeploy;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class DeployCommand extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('deploy')
+ ->setDescription('Deploys the list of GitHub Pages repositories.')
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $deploy = GitHubPagesDeploy::fromFile();
+ $repositories = $deploy->getRepositories();
+ if (empty($repositories)) {
+ $output->writeln('<info>gh-pages-deploy.json is empty.</info>');
+ }
+ else {
+ $deploy->update();
+ }
+ }
+}