mirror of
https://github.com/rclone/rclone.git
synced 2025-01-10 00:08:44 +01:00
drive: add --drive-skip-dangling-shortcuts flag - fixes #5949
This flag enables dangling shortcuts to be skipped without an error.
This commit is contained in:
parent
dc7e3ea1e3
commit
d3a1001094
@ -553,6 +553,14 @@ Google don't document so it may break in the future.
|
|||||||
Normally rclone dereferences shortcut files making them appear as if
|
Normally rclone dereferences shortcut files making them appear as if
|
||||||
they are the original file (see [the shortcuts section](#shortcuts)).
|
they are the original file (see [the shortcuts section](#shortcuts)).
|
||||||
If this flag is set then rclone will ignore shortcut files completely.
|
If this flag is set then rclone will ignore shortcut files completely.
|
||||||
|
`,
|
||||||
|
Advanced: true,
|
||||||
|
Default: false,
|
||||||
|
}, {
|
||||||
|
Name: "skip_dangling_shortcuts",
|
||||||
|
Help: `If set skip dangling shortcut files.
|
||||||
|
|
||||||
|
If this is set then rclone will not show any dangling shortcuts in listings.
|
||||||
`,
|
`,
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
@ -616,6 +624,7 @@ type Options struct {
|
|||||||
StopOnUploadLimit bool `config:"stop_on_upload_limit"`
|
StopOnUploadLimit bool `config:"stop_on_upload_limit"`
|
||||||
StopOnDownloadLimit bool `config:"stop_on_download_limit"`
|
StopOnDownloadLimit bool `config:"stop_on_download_limit"`
|
||||||
SkipShortcuts bool `config:"skip_shortcuts"`
|
SkipShortcuts bool `config:"skip_shortcuts"`
|
||||||
|
SkipDanglingShortcuts bool `config:"skip_dangling_shortcuts"`
|
||||||
Enc encoder.MultiEncoder `config:"encoding"`
|
Enc encoder.MultiEncoder `config:"encoding"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -918,6 +927,11 @@ OUTER:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false, fmt.Errorf("list: %w", err)
|
return false, fmt.Errorf("list: %w", err)
|
||||||
}
|
}
|
||||||
|
// leave the dangling shortcut out of the listings
|
||||||
|
// we've already logged about the dangling shortcut in resolveShortcut
|
||||||
|
if f.opt.SkipDanglingShortcuts && item.MimeType == shortcutMimeTypeDangling {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Check the case of items is correct since
|
// Check the case of items is correct since
|
||||||
// the `=` operator is case insensitive.
|
// the `=` operator is case insensitive.
|
||||||
|
Loading…
Reference in New Issue
Block a user