mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
[yabridgectl] Disallow adding individual files
This commit is contained in:
@@ -53,6 +53,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
|
|
||||||
### yabridgectl
|
### 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
|
- Deprecated support for the symlink-based installation method in yabridgectl
|
||||||
and removed all remaining mentions of it from the documentation. This feature
|
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,
|
has for all intents and purposes already been obselete since yabridge 2.1.0,
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ fn main() -> Result<()> {
|
|||||||
.display_order(1)
|
.display_order(1)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("path")
|
Arg::new("path")
|
||||||
.help("Path to a directory containing Windows VST plugins")
|
.help("Path to a directory containing Windows VST2 or VST3 plugins")
|
||||||
.validator(validate_path)
|
.validator(validate_directory)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.required(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.
|
/// Verify that a path exists, used for validating arguments.
|
||||||
fn validate_path(path: &str) -> Result<(), String> {
|
fn validate_path(path: &str) -> Result<(), String> {
|
||||||
let path = Path::new(path);
|
let path = Path::new(path);
|
||||||
|
|||||||
Reference in New Issue
Block a user