rearrange comments

This commit is contained in:
Cronfy 2016-02-16 16:07:17 +03:00
parent 869ef92769
commit 5586de7e63

View File

@ -327,16 +327,15 @@ env('releases_list', function () {
// find will list only dirs in releases/
$list = run('find {{deploy_path}}/releases -maxdepth 1 -mindepth 1 -type d')->toArray();
// filter anything that does not look like a release
// filter out anything that does not look like a release
foreach ($list as $key => $item) {
// name does not match
$item = basename($item); // strip path returned from find
// release dir can look like this: 20160216152237 or 20160216152237.1.2.3.4 ...
$name_match = '[0-9]{14}'; // 20160216152237
$extension_match = '\.[0-9]+'; // .1 or .15 etc
if (!preg_match("/^$name_match($extension_match)*$/", $item)) {
unset($list[$key]);
unset($list[$key]); // dir name does not match pattern, throw it out
continue;
}