diff options
author | Rob Loach <robloach@gmail.com> | 2015-02-07 22:05:07 -0500 |
---|---|---|
committer | Rob Loach <robloach@gmail.com> | 2015-02-07 22:05:07 -0500 |
commit | bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca (patch) | |
tree | 3530b776e0b69f6d7449a46224f46487ca576578 /src/GitHubPagesDeploy | |
parent | 7ca89a5eb6c7993658c9efce339f6805a0ee8351 (diff) | |
download | git-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.zip git-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.tar.gz git-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.tar.bz2 |
Rename to Git Deploy0.0.4
Diffstat (limited to 'src/GitHubPagesDeploy')
-rw-r--r-- | src/GitHubPagesDeploy/Console/Application.php | 24 | ||||
-rw-r--r-- | src/GitHubPagesDeploy/Console/Command/DeployCommand.php | 33 | ||||
-rw-r--r-- | src/GitHubPagesDeploy/GitHubPagesDeploy.php | 57 |
3 files changed, 0 insertions, 114 deletions
diff --git a/src/GitHubPagesDeploy/Console/Application.php b/src/GitHubPagesDeploy/Console/Application.php deleted file mode 100644 index a7791ad..0000000 --- a/src/GitHubPagesDeploy/Console/Application.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace GitHubPagesDeploy\Console; - -use Symfony\Component\Console\Application as BaseApplication; -use GitHubPagesDeploy\Console\Command\DeployCommand; - -class Application extends BaseApplication -{ - const NAME = 'GitHub Pages Deploy'; - const VERSION = '@package_version@'; - - public function __construct() - { - parent::__construct(static::NAME, static::VERSION); - } - - protected function getDefaultCommands() - { - $defaultCommands = parent::getDefaultCommands(); - $defaultCommands[] = new DeployCommand(); - return $defaultCommands; - } -} diff --git a/src/GitHubPagesDeploy/Console/Command/DeployCommand.php b/src/GitHubPagesDeploy/Console/Command/DeployCommand.php deleted file mode 100644 index 70c7d8a..0000000 --- a/src/GitHubPagesDeploy/Console/Command/DeployCommand.php +++ /dev/null @@ -1,33 +0,0 @@ -<?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(); - } - } -} diff --git a/src/GitHubPagesDeploy/GitHubPagesDeploy.php b/src/GitHubPagesDeploy/GitHubPagesDeploy.php deleted file mode 100644 index 0fb0a0c..0000000 --- a/src/GitHubPagesDeploy/GitHubPagesDeploy.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -namespace GitHubPagesDeploy; - -use GitWrapper\GitWrapper; -use GitWrapper\GitWorkingCopy; - -class GitHubPagesDeploy -{ - protected $repositories; - - public function __construct($repositories = array()) - { - $this->repositories = $repositories; - } - - public static function fromFile($file = 'gh-pages-deploy.json') - { - $results = array(); - - if (is_file($file)) { - $contents = file_get_contents($file); - $results = json_decode($contents); - } - - return new GitHubPagesDeploy($results); - } - - public function update() - { - // Create the wrapper. - $wrapper = new GitWrapper(); - $wrapper->streamOutput(); - - foreach ($this->repositories as $dir => $repo) { - // Build our git interface. - $git = null; - if (!is_dir($dir)) { - $git = $wrapper->cloneRepository($repo, $dir); - } - else { - $git = new GitWorkingCopy($wrapper, $dir); - } - - // Fetch all the latest. - $git->fetch('--all'); - - // Reset over to the gh-pages branch. - $git->reset('origin/gh-pages', array('hard' => true)); - } - } - - public function getRepositories() - { - return $this->repositories; - } -} |