[yabridgectl] Gracefully catch bundle subdir error

This could only occur if people go out of their way to do weird things
and add the `x86_64-win` directory inside of a VST3 bundle to their
plugin locations. But somehow people still manage to do just that.....
This commit is contained in:
Robbert van der Helm
2022-06-12 23:56:39 +02:00
parent 67747531cc
commit a282bdc9d1
2 changed files with 23 additions and 12 deletions
+8
View File
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### yabridge
- Don't panic when someone `yabridgectl add`'ed part of the contents of a
Windows VST3 bundle. For the record, you really, really, _really_ shouldn't be
doing this.
## [4.0.1] - 2022-06-12
### Added
+11 -8
View File
@@ -599,18 +599,21 @@ impl SearchIndex {
// The subdirectory should be relative to the bundle, not to the .vst3
// file inside of the bundle. The latter is what we get from the index
// function since it only considers regular files and symlinks.
subdirectory.map(|subdirectory| {
subdirectory.and_then(|subdirectory| {
// NOTE: Just `.uwnrapping()` all of these and using `.map()`
// instead of `.and_then()` should be sufficient, but for some
// reason people add the `x86_64-win` directory inside of a
// VST3 bundle to their plugin locations........why?
Some(
subdirectory
// x86_64-win
.parent()
.unwrap()
.parent()?
// Contents
.parent()
.unwrap()
.parent()?
// foo.vst3
.parent()
.unwrap()
.to_owned()
.parent()?
.to_owned(),
)
}),
)
} else {