From 6a673a7bd2a88c759e79cf31347ac27fab897187 Mon Sep 17 00:00:00 2001 From: Elfet Date: Mon, 7 Jul 2014 17:44:06 +0400 Subject: [PATCH] Allow to start Deployer console app if there are no deploy.php file. --- bin/dep | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/bin/dep b/bin/dep index b12310a4..71dfa717 100755 --- a/bin/dep +++ b/bin/dep @@ -27,28 +27,26 @@ if (!$loaded) { // Recipe include path set_include_path(__DIR__ . '/../'); +// Init Deployer +$deployer = new \Deployer\Deployer( + new \Symfony\Component\Console\Application('Deployer', '__VERSION__'), + new \Symfony\Component\Console\Input\ArgvInput(), + new \Symfony\Component\Console\Output\ConsoleOutput() +); + +// Require current deploy.php script $deployFile = getcwd() . '/deploy.php'; if (is_file($deployFile) && is_readable($deployFile)) { - // Init Deployer - $deployer = new \Deployer\Deployer( - new \Symfony\Component\Console\Application('Deployer', '__VERSION__'), - new \Symfony\Component\Console\Input\ArgvInput(), - new \Symfony\Component\Console\Output\ConsoleOutput() - ); - - // Require current deploy.php script require $deployFile; +} - // Self-update command - $selfUpdate = new \KevinGH\Amend\Command('self-update'); - $selfUpdate->setDescription('Updates deployer.phar to the latest version'); - $selfUpdate->setManifestUri('https://raw.github.com/elfet/deployer/master/manifest.json'); - $deployer->getConsole()->add($selfUpdate); - $deployer->getHelperSet()->set(new \KevinGH\Amend\Helper()); +// Self-update command +$selfUpdate = new \KevinGH\Amend\Command('self-update'); +$selfUpdate->setDescription('Updates deployer.phar to the latest version'); +$selfUpdate->setManifestUri('https://raw.github.com/elfet/deployer/master/manifest.json'); +$deployer->getConsole()->add($selfUpdate); +$deployer->getHelperSet()->set(new \KevinGH\Amend\Helper()); - // Run Deployer - $deployer->run(); -} else { - echo "deploy.php file does not found.\n"; -} \ No newline at end of file +// Run Deployer +$deployer->run();