mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-02 22:13:16 +02:00
Fix where --resync is enforced for non-sync operations (#2111)
* Fix that the --resync option is wrongly enforced when the OneDrive client is started with --list-shared-folders option or other non-sync options. This only happens when configuration changes are detected.
This commit is contained in:
parent
33423ee441
commit
3b7a06cdcd
15
src/main.d
15
src/main.d
|
@ -457,9 +457,18 @@ int main(string[] args)
|
|||
|
||||
// Has anything triggered a --resync requirement?
|
||||
if (configOptionsDifferent || syncListDifferent || syncDirDifferent || skipFileDifferent || skipDirDifferent || businessSharedFoldersDifferent) {
|
||||
// --resync needed, is the user just testing configuration changes?
|
||||
if (!cfg.getValueBool("display_config")){
|
||||
// not testing configuration changes
|
||||
// --resync needed, is the user performing any operation where a --resync is not required?
|
||||
// flag to ignore --resync requirement
|
||||
bool ignoreResyncRequirement = false;
|
||||
// These flags do not need --resync as no sync operation is needed: --display-config, --list-shared-folders, --get-O365-drive-id, --get-file-link
|
||||
if (cfg.getValueBool("display_config")) ignoreResyncRequirement = true;
|
||||
if (cfg.getValueBool("list_business_shared_folders")) ignoreResyncRequirement = true;
|
||||
if ((!cfg.getValueString("get_o365_drive_id").empty)) ignoreResyncRequirement = true;
|
||||
if ((!cfg.getValueString("get_file_link").empty)) ignoreResyncRequirement = true;
|
||||
|
||||
// Do we need to ignore a --resync requirement?
|
||||
if (!ignoreResyncRequirement) {
|
||||
// We are not ignoring --requirement
|
||||
if (!cfg.getValueBool("resync")) {
|
||||
// --resync not issued, fail fast
|
||||
log.error("An application configuration change has been detected where a --resync is required");
|
||||
|
|
Loading…
Reference in a new issue