mirror of
https://github.com/getgrav/grav.git
synced 2026-03-05 03:51:50 +01:00
ignore all .git folders
This commit is contained in:
@@ -14,14 +14,17 @@ class ZipBackup
|
||||
{
|
||||
use GravTrait;
|
||||
|
||||
protected static $ignore = [
|
||||
'.git',
|
||||
protected static $ignorePaths = [
|
||||
'backup',
|
||||
'cache',
|
||||
'images',
|
||||
'logs'
|
||||
];
|
||||
|
||||
protected static $ignoreFolders = [
|
||||
'.git'
|
||||
];
|
||||
|
||||
public static function backup($destination = null, callable $messager = null)
|
||||
{
|
||||
if (!$destination) {
|
||||
@@ -94,7 +97,7 @@ class ZipBackup
|
||||
// Remove prefix from file path before add to zip.
|
||||
$localPath = substr($filePath, $exclusiveLength);
|
||||
|
||||
if (in_array($localPath, static::$ignore)) {
|
||||
if (in_array($f, static::$ignoreFolders) || in_array($localPath, static::$ignorePaths)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user