mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-01 21:42:16 +02:00
Expanded skip_file config parameter to support spaces and pathing
This commit is contained in:
parent
83c28ba3b6
commit
a4387d5fc4
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ onedrive
|
|||
onedrive.o
|
||||
onedrive.service
|
||||
version
|
||||
onedrive@.service
|
||||
|
|
|
@ -5,6 +5,7 @@ import std.path;
|
|||
import std.regex;
|
||||
import std.stdio;
|
||||
import util;
|
||||
static import log;
|
||||
|
||||
final class SelectiveSync
|
||||
{
|
||||
|
@ -33,13 +34,17 @@ final class SelectiveSync
|
|||
// Does the file match skip_file config entry?
|
||||
// Returns true if the file matches a skip_file config entry
|
||||
// Returns false if no match
|
||||
log.vlog("isNameExcluded for name '", name, "': ", !name.matchFirst(mask).empty);
|
||||
return !name.matchFirst(mask).empty;
|
||||
}
|
||||
|
||||
// config sync_list file handling
|
||||
// also incorporates skip_file config parameter for expanded regex path matching
|
||||
bool isPathExcluded(string path)
|
||||
{
|
||||
return .isPathExcluded(path, paths);
|
||||
log.vlog("isPathExcluded for path '", path, "': ", .isPathExcluded(path, paths));
|
||||
log.vlog("Path Matched for path '", path, "': ", !path.matchFirst(mask).empty);
|
||||
return .isPathExcluded(path, paths) || !path.matchFirst(mask).empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,12 @@ Regex!char wild2regex(const(char)[] pattern)
|
|||
case '+':
|
||||
str ~= "\\+";
|
||||
break;
|
||||
case ' ':
|
||||
str ~= "\\s+";
|
||||
break;
|
||||
case '/':
|
||||
str ~= "\\/";
|
||||
break;
|
||||
default:
|
||||
str ~= c;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue