diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cc05ba7..f768fefe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### yabridgectl +- Yabridgectl's help text received some new colors. +- Disallowed adding (symlinks to) individual files with `yabridgectl add`. + Yabridgectl was never intended to be used that way, and while it does sort of + work, it will lead to certain surprises down the line. - Deprecated support for the symlink-based installation method in yabridgectl and removed all remaining mentions of it from the documentation. This feature has for all intents and purposes already been obselete since yabridge 2.1.0, diff --git a/tools/yabridgectl/src/main.rs b/tools/yabridgectl/src/main.rs index 6ce6dc40..c14a34fb 100644 --- a/tools/yabridgectl/src/main.rs +++ b/tools/yabridgectl/src/main.rs @@ -60,8 +60,8 @@ fn main() -> Result<()> { .display_order(1) .arg( Arg::new("path") - .help("Path to a directory containing Windows VST plugins") - .validator(validate_path) + .help("Path to a directory containing Windows VST2 or VST3 plugins") + .validator(validate_directory) .takes_value(true) .required(true), ), @@ -301,6 +301,18 @@ fn main() -> Result<()> { } } +/// Verify that a path exists and that is is either a directory or a symlink to a directory. +fn validate_directory(path: &str) -> Result<(), String> { + validate_path(path)?; + + let path = Path::new(path); + if path.is_dir() { + Ok(()) + } else { + Err(format!("'{}' is not a directory", path.display())) + } +} + /// Verify that a path exists, used for validating arguments. fn validate_path(path: &str) -> Result<(), String> { let path = Path::new(path);