Refactor deploy:is-unlocked to deploy:is_locked

This commit is contained in:
Anton Medvedev 2021-10-11 22:08:58 +02:00
parent 083a30003d
commit 3105caa1ce
2 changed files with 6 additions and 7 deletions

View File

@ -28,10 +28,10 @@ Unlock deploy.
### deploy:is-unlocked
### deploy:is_locked
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/lock.php#L25)
Check if deploy is unlocked.
Check if deploy is locked.

View File

@ -21,12 +21,11 @@ task('deploy:unlock', function () {
run("rm -f {{deploy_path}}/.dep/deploy.lock");//always success
});
desc('Check if deploy is unlocked');
task('deploy:is-unlocked', function () {
desc('Check if deploy is locked');
task('deploy:is_locked', function () {
$locked = test("[ -f {{deploy_path}}/.dep/deploy.lock ]");
if ($locked) {
writeln('Deploy is currently locked.');
throw new GracefulShutdownException();
throw new GracefulShutdownException("Deploy is locked.");
}
writeln('Deploy is currently unlocked.');
info('Deploy is unlocked.');
});