mirror of
https://github.com/YGGverse/Yo.git
synced 2026-03-31 17:55:35 +00:00
fix snap cleanup rules
This commit is contained in:
parent
c618714cd2
commit
587fa26027
1 changed files with 10 additions and 2 deletions
|
|
@ -123,9 +123,17 @@ foreach ($config->cli->document->crawl->skip->stripos->url as $condition)
|
||||||
|
|
||||||
if (is_dir($location))
|
if (is_dir($location))
|
||||||
{
|
{
|
||||||
if (rmdir($location))
|
foreach ((array) scandir($location) as $filename)
|
||||||
{
|
{
|
||||||
$snaps++;
|
if (is_dir($filename) || is_link($filename) || str_starts_with($filename, '.') || !str_ends_with($filename, '.tar.gz'))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unlink($filename))
|
||||||
|
{
|
||||||
|
$snaps++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue