summaryrefslogtreecommitdiffstats
path: root/src/GitHubPagesDeploy/Console/Command/DeployCommand.php
diff options
context:
space:
mode:
authorRob Loach <robloach@gmail.com>2013-12-14 16:41:10 -0500
committerRob Loach <robloach@gmail.com>2013-12-14 16:41:10 -0500
commit2596307917045df71d8922d7bc46bad00f5ec694 (patch)
tree05ba8d84756332a1eecfe0896472cd5e43f7ca5c /src/GitHubPagesDeploy/Console/Command/DeployCommand.php
parentd0fc289e7839727ea42abfa6244713a4a94991dc (diff)
downloadgit-deploy-2596307917045df71d8922d7bc46bad00f5ec694.zip
git-deploy-2596307917045df71d8922d7bc46bad00f5ec694.tar.gz
git-deploy-2596307917045df71d8922d7bc46bad00f5ec694.tar.bz2
Initial commit
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();
+ }
+ }
+}