Fix code style

This commit is contained in:
Anton Medvedev 2021-09-24 10:46:32 +02:00
parent 91fbb66b0f
commit 9ae2b96c23
2 changed files with 5 additions and 9 deletions

View File

@ -21,7 +21,7 @@ Lock deploy.
### deploy:unlock
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/lock.php#L22)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/lock.php#L21)
Unlock deploy.
@ -29,7 +29,7 @@ Unlock deploy.
### deploy:is-unlocked
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/lock.php#L27)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/lock.php#L26)
Check if deploy is unlocked.

View File

@ -1,13 +1,12 @@
<?php
namespace Deployer;
use Deployer\Exception\GracefulShutdownException;
use Deployer\Exception\RunException;
desc('Lock deploy');
task('deploy:lock', function () {
$locked = test("[ -f {{deploy_path}}/.dep/deploy.lock ]");
if ($locked) {
throw new GracefulShutdownException(
"Deploy locked.\n" .
@ -26,12 +25,9 @@ task('deploy:unlock', function () {
desc('Check if deploy is unlocked');
task('deploy:is-unlocked', function () {
$locked = test("[ -f {{deploy_path}}/.dep/deploy.lock ]");
if ($locked) {
writeln( 'Deploy is currently locked.');
writeln('Deploy is currently locked.');
throw new GracefulShutdownException();
}
writeln( 'Deploy is currently unlocked.');
writeln('Deploy is currently unlocked.');
});