summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Loach <robloach@gmail.com>2015-02-07 22:05:07 -0500
committerRob Loach <robloach@gmail.com>2015-02-07 22:05:07 -0500
commitbc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca (patch)
tree3530b776e0b69f6d7449a46224f46487ca576578 /src
parent7ca89a5eb6c7993658c9efce339f6805a0ee8351 (diff)
downloadgit-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.zip
git-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.tar.gz
git-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.tar.bz2
Rename to Git Deploy0.0.4
Diffstat (limited to 'src')
-rw-r--r--src/GitDeploy/Console/Application.php (renamed from src/GitHubPagesDeploy/Console/Application.php)6
-rw-r--r--src/GitDeploy/Console/Command/DeployCommand.php (renamed from src/GitHubPagesDeploy/Console/Command/DeployCommand.php)17
-rw-r--r--src/GitDeploy/GitDeploy.php (renamed from src/GitHubPagesDeploy/GitHubPagesDeploy.php)11
3 files changed, 22 insertions, 12 deletions
diff --git a/src/GitHubPagesDeploy/Console/Application.php b/src/GitDeploy/Console/Application.php
index a7791ad..0ba70c9 100644
--- a/src/GitHubPagesDeploy/Console/Application.php
+++ b/src/GitDeploy/Console/Application.php
@@ -1,13 +1,13 @@
<?php
-namespace GitHubPagesDeploy\Console;
+namespace GitDeploy\Console;
use Symfony\Component\Console\Application as BaseApplication;
-use GitHubPagesDeploy\Console\Command\DeployCommand;
+use GitDeploy\Console\Command\DeployCommand;
class Application extends BaseApplication
{
- const NAME = 'GitHub Pages Deploy';
+ const NAME = 'Git Deploy';
const VERSION = '@package_version@';
public function __construct()
diff --git a/src/GitHubPagesDeploy/Console/Command/DeployCommand.php b/src/GitDeploy/Console/Command/DeployCommand.php
index 70c7d8a..b504d4b 100644
--- a/src/GitHubPagesDeploy/Console/Command/DeployCommand.php
+++ b/src/GitDeploy/Console/Command/DeployCommand.php
@@ -1,8 +1,8 @@
<?php
-namespace GitHubPagesDeploy\Console\Command;
+namespace GitDeploy\Console\Command;
-use GitHubPagesDeploy\GitHubPagesDeploy;
+use GitDeploy\GitDeploy;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
@@ -15,16 +15,23 @@ class DeployCommand extends Command
{
$this
->setName('deploy')
- ->setDescription('Deploys the list of GitHub Pages repositories.')
+ ->setDescription('Deploys the list of repositories.')
+ ->addOption(
+ 'file',
+ 'f',
+ InputOption::VALUE_OPTIONAL,
+ 'The configuration file to load.',
+ 'git-deploy.json'
+ )
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
- $deploy = GitHubPagesDeploy::fromFile();
+ $deploy = GitDeploy::fromFile($input->getOption('file'));
$repositories = $deploy->getRepositories();
if (empty($repositories)) {
- $output->writeln('<info>gh-pages-deploy.json is empty.</info>');
+ $output->writeln('<info>Configuration file empty.</info>');
}
else {
$deploy->update();
diff --git a/src/GitHubPagesDeploy/GitHubPagesDeploy.php b/src/GitDeploy/GitDeploy.php
index 0fb0a0c..d1c2cf6 100644
--- a/src/GitHubPagesDeploy/GitHubPagesDeploy.php
+++ b/src/GitDeploy/GitDeploy.php
@@ -1,11 +1,11 @@
<?php
-namespace GitHubPagesDeploy;
+namespace GitDeploy;
use GitWrapper\GitWrapper;
use GitWrapper\GitWorkingCopy;
-class GitHubPagesDeploy
+class GitDeploy
{
protected $repositories;
@@ -14,7 +14,7 @@ class GitHubPagesDeploy
$this->repositories = $repositories;
}
- public static function fromFile($file = 'gh-pages-deploy.json')
+ public static function fromFile($file = 'git-deploy.json')
{
$results = array();
@@ -23,7 +23,7 @@ class GitHubPagesDeploy
$results = json_decode($contents);
}
- return new GitHubPagesDeploy($results);
+ return new GitDeploy($results);
}
public function update()
@@ -47,6 +47,9 @@ class GitHubPagesDeploy
// Reset over to the gh-pages branch.
$git->reset('origin/gh-pages', array('hard' => true));
+
+ // Remove any extra files.
+ $git->clean('-d', '-f', '-x');
}
}