mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-23 08:02:16 +02:00
Support comments in sync_list file (#958)
* If sync_list contains a comment line, exclude this from sync_list processing
This commit is contained in:
parent
1c10effb9b
commit
93163051f5
|
@ -17,11 +17,15 @@ final class SelectiveSync
|
||||||
void load(string filepath)
|
void load(string filepath)
|
||||||
{
|
{
|
||||||
if (exists(filepath)) {
|
if (exists(filepath)) {
|
||||||
paths = File(filepath)
|
// open file as read only
|
||||||
.byLine()
|
auto file = File(filepath, "r");
|
||||||
.map!(a => buildNormalizedPath(a))
|
auto range = file.byLine();
|
||||||
.filter!(a => a.length > 0)
|
foreach (line; range) {
|
||||||
.array;
|
// Skip comments in file
|
||||||
|
if (line.length == 0 || line[0] == ';' || line[0] == '#') continue;
|
||||||
|
paths ~= buildNormalizedPath(line);
|
||||||
|
}
|
||||||
|
file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue