Skip to content

Commit 0b40e8b

Browse files
committed
Merge branch 'master' of github.com:deployphp/deployer
2 parents 48a8be9 + a352114 commit 0b40e8b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

recipe/common.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@
3535
}
3636
return version_compare($version, '2.3', '>=');
3737
});
38-
env('release_name', date('YmdHis')); // name of folder in releases
38+
env('release_name', function () {
39+
// Set the deployment timezone
40+
if (!date_default_timezone_set(env('timezone'))) {
41+
date_default_timezone_set('UTC');
42+
}
43+
44+
return date('YmdHis');
45+
}); // name of folder in releases
3946

4047
/**
4148
* Custom bins.
@@ -119,11 +126,6 @@
119126
throw $e;
120127
}
121128

122-
// Set the deployment timezone
123-
if (!date_default_timezone_set(env('timezone'))) {
124-
date_default_timezone_set('UTC');
125-
}
126-
127129
run('if [ ! -d {{deploy_path}} ]; then mkdir -p {{deploy_path}}; fi');
128130

129131
// Check for existing /current directory (not symlink)
@@ -150,10 +152,10 @@
150152
* Release
151153
*/
152154
task('deploy:release', function () {
153-
$releasePath = "{{deploy_path}}/releases/{{release_name}}";
155+
$releasePath = env()->parse("{{deploy_path}}/releases/{{release_name}}");
154156

155157
$i = 0;
156-
while (is_dir(env()->parse($releasePath)) && $i < 42) {
158+
while (run("if [ -d $releasePath ]; then echo 'true'; fi")->toBool()) {
157159
$releasePath .= '.' . ++$i;
158160
}
159161

0 commit comments

Comments
 (0)