Update --single-directory path handling when path does not exist locally (#1031)

* If the requested path for --single-directory does not exist locally, create it rather than display error and exit
This commit is contained in:
abraunegg 2020-08-21 07:06:56 +10:00 committed by GitHub
parent 2099ec2994
commit 431678753d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -846,10 +846,10 @@ int main(string[] args)
if (cfg.getValueString("single_directory") != "") {
// Does the directory we want to sync actually exist?
if (!exists(cfg.getValueString("single_directory"))) {
// the requested directory does not exist ..
log.logAndNotify("ERROR: The requested local directory does not exist. Please check ~/OneDrive/ for requested path");
// Use exit scopes to shutdown API
return EXIT_FAILURE;
// The requested path to use with --single-directory does not exist locally within the configured 'sync_dir'
log.logAndNotify("WARNING: The requested path for --single-directory does not exist locally. Creating requested path within ", syncDir);
// Make the required path locally
mkdirRecurse(cfg.getValueString("single_directory"));
}
}
// perform a --synchronize sync