From 5773c471f9ff9c8235c0c29a4179d3db8e8909a8 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 27 Dec 2020 18:24:41 +0100 Subject: [PATCH] [yabridgectl] Don't purge VST3 yabridge.toml We only want to consider directories here. --- tools/yabridgectl/src/actions.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/yabridgectl/src/actions.rs b/tools/yabridgectl/src/actions.rs index 59bc2e20..3e3a1db5 100644 --- a/tools/yabridgectl/src/actions.rs +++ b/tools/yabridgectl/src/actions.rs @@ -322,12 +322,15 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> { dirs.filter_map(|entry| entry.ok()) .map(|entry| entry.path()) .filter_map(|path| { - // Add all files and directories in `~/.vst3/yabridge` to `orphan_files` if they - // are not a VST3 module we just created - if !yabridge_vst3_bundles.contains_key(&path) { - utils::get_file_type(path) - } else { - None + // Add all directories in `~/.vst3/yabridge` to `orphan_files` if they are not a + // VST3 module we just created. We'll ignore symlinks and regular files since + // those are always user created. + match ( + yabridge_vst3_bundles.contains_key(&path), + utils::get_file_type(path), + ) { + (false, result @ Some(NativeFile::Directory(_))) => result, + _ => None, } }), );