mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Add a descriptive error when winedump is missing
This commit is contained in:
@@ -169,7 +169,7 @@ impl Config {
|
|||||||
|
|
||||||
/// Search for VST2 plugins in all of the registered plugins directories. This will return an
|
/// Search for VST2 plugins in all of the registered plugins directories. This will return an
|
||||||
/// error if `winedump` could not be called.
|
/// error if `winedump` could not be called.
|
||||||
pub fn index_directories(&self) -> Result<BTreeMap<&Path, SearchResults>, std::io::Error> {
|
pub fn index_directories(&self) -> Result<BTreeMap<&Path, SearchResults>> {
|
||||||
self.plugin_dirs
|
self.plugin_dirs
|
||||||
.par_iter()
|
.par_iter()
|
||||||
.map(|path| files::index(path).map(|search_results| (path.as_path(), search_results)))
|
.map(|path| files::index(path).map(|search_results| (path.as_path(), search_results)))
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
//! Functions to index plugins and to set up yabridge for those plugins.
|
//! Functions to index plugins and to set up yabridge for those plugins.
|
||||||
|
|
||||||
use aho_corasick::AhoCorasick;
|
use aho_corasick::AhoCorasick;
|
||||||
|
use anyhow::{Context, Result};
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
@@ -97,7 +98,7 @@ impl FoundFile {
|
|||||||
|
|
||||||
/// Search for Windows VST2 plugins and .so files under a directory. This will return an error if
|
/// Search for Windows VST2 plugins and .so files under a directory. This will return an error if
|
||||||
/// the directory does not exist, or if `winedump` could not be found.
|
/// the directory does not exist, or if `winedump` could not be found.
|
||||||
pub fn index(directory: &Path) -> Result<SearchResults, std::io::Error> {
|
pub fn index(directory: &Path) -> Result<SearchResults> {
|
||||||
// First we'll find all .dll and .so files in the directory
|
// First we'll find all .dll and .so files in the directory
|
||||||
let (dll_files, so_files) = find_files(directory);
|
let (dll_files, so_files) = find_files(directory);
|
||||||
|
|
||||||
@@ -116,12 +117,16 @@ pub fn index(directory: &Path) -> Result<SearchResults, std::io::Error> {
|
|||||||
.arg("-j")
|
.arg("-j")
|
||||||
.arg("export")
|
.arg("export")
|
||||||
.arg(&path)
|
.arg(&path)
|
||||||
.output()?
|
.output()
|
||||||
|
.context(
|
||||||
|
"Could not find 'winedump'. In some distributions this is part of a seperate \
|
||||||
|
Wine tools package.",
|
||||||
|
)?
|
||||||
.stdout;
|
.stdout;
|
||||||
|
|
||||||
Ok((path, VST2_AUTOMATON.is_match(exported_functions)))
|
Ok((path, VST2_AUTOMATON.is_match(exported_functions)))
|
||||||
})
|
})
|
||||||
.collect::<Result<_, std::io::Error>>()?;
|
.collect::<Result<_>>()?;
|
||||||
|
|
||||||
let mut vst2_files = Vec::new();
|
let mut vst2_files = Vec::new();
|
||||||
let mut skipped_files = Vec::new();
|
let mut skipped_files = Vec::new();
|
||||||
|
|||||||
Reference in New Issue
Block a user