mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-12 18:56:41 +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)
|
||||
{
|
||||
if (exists(filepath)) {
|
||||
paths = File(filepath)
|
||||
.byLine()
|
||||
.map!(a => buildNormalizedPath(a))
|
||||
.filter!(a => a.length > 0)
|
||||
.array;
|
||||
// open file as read only
|
||||
auto file = File(filepath, "r");
|
||||
auto range = file.byLine();
|
||||
foreach (line; range) {
|
||||
// Skip comments in file
|
||||
if (line.length == 0 || line[0] == ';' || line[0] == '#') continue;
|
||||
paths ~= buildNormalizedPath(line);
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue