Use config set option for 'remove_source_files' and 'skip_dir_strict_match' rather than ignore (#1142)

* Remove items from direct config string update, as they are configurable via config file, thus set option via config file is not used
* Add debugging and application config output for used options
This commit is contained in:
abraunegg 2020-11-14 06:17:53 +11:00 committed by GitHub
parent cb57213fb9
commit 550ab4b6dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -282,8 +282,6 @@ final class Config
boolValues["monitor"] = false; boolValues["monitor"] = false;
boolValues["synchronize"] = false; boolValues["synchronize"] = false;
boolValues["force"] = false; boolValues["force"] = false;
boolValues["remove_source_files"] = false;
boolValues["skip_dir_strict_match"] = false;
boolValues["list_business_shared_folders"] = false; boolValues["list_business_shared_folders"] = false;
// Application Startup option validation // Application Startup option validation

View file

@ -509,6 +509,9 @@ int main(string[] args)
writeln("Config option 'min_notify_changes' = ", cfg.getValueLong("min_notify_changes")); writeln("Config option 'min_notify_changes' = ", cfg.getValueLong("min_notify_changes"));
writeln("Config option 'log_dir' = ", cfg.getValueString("log_dir")); writeln("Config option 'log_dir' = ", cfg.getValueString("log_dir"));
writeln("Config option 'classify_as_big_delete' = ", cfg.getValueLong("classify_as_big_delete")); writeln("Config option 'classify_as_big_delete' = ", cfg.getValueLong("classify_as_big_delete"));
writeln("Config option 'upload_only' = ", cfg.getValueBool("upload_only"));
writeln("Config option 'no_remote_delete' = ", cfg.getValueBool("no_remote_delete"));
writeln("Config option 'remove_source_files' = ", cfg.getValueBool("remove_source_files"));
// Is config option drive_id configured? // Is config option drive_id configured?
if (cfg.getValueString("drive_id") != ""){ if (cfg.getValueString("drive_id") != ""){
@ -765,14 +768,18 @@ int main(string[] args)
// Do we need to configure specific --upload-only options? // Do we need to configure specific --upload-only options?
if (cfg.getValueBool("upload_only")) { if (cfg.getValueBool("upload_only")) {
// --upload-only was passed in or configured // --upload-only was passed in or configured
log.log("Configuring uploadOnly flag to TRUE as --upload-only passed in or configured");
sync.setUploadOnly();
// was --no-remote-delete passed in or configured // was --no-remote-delete passed in or configured
if (cfg.getValueBool("no_remote_delete")) { if (cfg.getValueBool("no_remote_delete")) {
// Configure the noRemoteDelete flag // Configure the noRemoteDelete flag
log.log("Configuring noRemoteDelete flag to TRUE as --no-remote-delete passed in or configured");
sync.setNoRemoteDelete(); sync.setNoRemoteDelete();
} }
// was --remove-source-files passed in or configured // was --remove-source-files passed in or configured
if (cfg.getValueBool("remove_source_files")) { if (cfg.getValueBool("remove_source_files")) {
// Configure the localDeleteAfterUpload flag // Configure the localDeleteAfterUpload flag
log.log("Configuring localDeleteAfterUpload flag to TRUE as --remove-source-files passed in or configured");
sync.setLocalDeleteAfterUpload(); sync.setLocalDeleteAfterUpload();
} }
} }