mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 01:02:24 +01:00
fix #558: check releases_list to contain only releases
This commit is contained in:
parent
c692d7cb5b
commit
c35a9e4488
@ -326,6 +326,18 @@ task('deploy:symlink', function () {
|
||||
env('releases_list', function () {
|
||||
$list = run('ls {{deploy_path}}/releases')->toArray();
|
||||
|
||||
// filter anything that does not look like a release
|
||||
foreach ($list as $key => $item) {
|
||||
// name does not match
|
||||
if (!preg_match('/^[0-9]{14}$/', $item)) {
|
||||
unset($list[$key]);
|
||||
}
|
||||
// not a directory
|
||||
if (!is_dir(env('deploy_path') . '/releases/' . $item)) {
|
||||
unset($list[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
rsort($list);
|
||||
|
||||
return $list;
|
||||
|
Loading…
x
Reference in New Issue
Block a user