mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-09 01:06:40 +02:00
Fix 'Local files not deleted' when using bad 'skip_file' entry (#480)
* Add a check for bad 'skip_file' entry that prevents incorrect searching of local changes (mainly deletes) from being synced
This commit is contained in:
parent
daec620c1a
commit
fbad4b4835
13
src/main.d
13
src/main.d
|
@ -282,9 +282,20 @@ int main(string[] args)
|
|||
log.vdebug("skip_dir: ", cfg.getValueString("skip_dir"));
|
||||
selectiveSync.setDirMask(cfg.getValueString("skip_dir"));
|
||||
log.vdebug("Configuring skip_file ...");
|
||||
// Validate skip_file to ensure that this does not contain an invalid configuration
|
||||
// Do not use a skip_file entry of .* as this will prevent correct searching of local changes to process.
|
||||
foreach(entry; cfg.getValueString("skip_file").split("|")){
|
||||
if (entry == ".*") {
|
||||
// invalid entry element detected
|
||||
log.logAndNotify("ERROR: Invalid skip_file entry '.*' detected");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
// valid entry
|
||||
log.vdebug("skip_file: ", cfg.getValueString("skip_file"));
|
||||
selectiveSync.setFileMask(cfg.getValueString("skip_file"));
|
||||
|
||||
|
||||
// Initialize the sync engine
|
||||
log.logAndNotify("Initializing the Synchronization Engine ...");
|
||||
auto sync = new SyncEngine(cfg, oneDrive, itemDb, selectiveSync);
|
||||
|
|
Loading…
Reference in a new issue