diff --git a/CHANGELOG.md b/CHANGELOG.md index d65bd24a..74965a54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,10 @@ TODO: Add an updated screenshot with some fancy VST3-only plugins to the readme - Added the `yabridgectl set --path-auto` option to revert back to automatically locating yabridge's files after manually setting a path with `yabridgectl set --path=<...>`. +- Added the `yabridgectl set --no-verify={true,false}` option to permanently + disable post-installation setup checks. You can still directly pass the + `--no-verify` argument to `yabridgectl sync` to disable these checks for only + a single invocation. ## [2.2.1] - 2020-12-12 diff --git a/tools/yabridgectl/src/actions.rs b/tools/yabridgectl/src/actions.rs index cdd7f404..d34df70b 100644 --- a/tools/yabridgectl/src/actions.rs +++ b/tools/yabridgectl/src/actions.rs @@ -138,6 +138,7 @@ pub struct SetOptions<'a> { pub method: Option<&'a str>, pub path: Option, pub path_auto: bool, + pub no_verify: Option, } /// Change configuration settings. The actual options are defined in the clap [app](clap::App). @@ -157,6 +158,10 @@ pub fn set_settings(config: &mut Config, options: &SetOptions) -> Result<()> { config.yabridge_home = None; } + if let Some(no_verify) = options.no_verify { + config.no_verify = no_verify; + } + config.write() } @@ -383,7 +388,9 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> { num_skipped_files ); - if options.no_verify { + // Skipping the post-installation seting checks can be done only for this invocation of + // `yabridgectl sync`, or it can be skipped permanently through a config file option + if options.no_verify || config.no_verify { return Ok(()); } diff --git a/tools/yabridgectl/src/config.rs b/tools/yabridgectl/src/config.rs index 986c0377..dbcc2f1f 100644 --- a/tools/yabridgectl/src/config.rs +++ b/tools/yabridgectl/src/config.rs @@ -53,6 +53,7 @@ const YABRIDGE_VST3_HOME: &str = ".vst3/yabridge"; /// The configuration used for yabridgectl. This will be serialized to and deserialized from /// `$XDG_CONFIG_HOME/yabridge/config.toml`. #[derive(Deserialize, Serialize, Debug)] +#[serde(default)] pub struct Config { /// The installation method to use. We will default to creating copies since that works /// everywhere. @@ -66,6 +67,9 @@ pub struct Config { /// Files/Common/VST3`). We're using an ordered set here out of convenience so we can't get /// duplicates and the config file is always sorted. pub plugin_dirs: BTreeSet, + /// Always skip post-installation setup checks. This can be set temporarily by passing the + /// `--no-verify` option to `yabridgectl sync`. + pub no_verify: bool, /// The last known combination of Wine and yabridge versions that would work together properly. /// This is mostly to diagnose issues with older Wine versions (such as those in Ubuntu's repos) /// early on. @@ -144,6 +148,18 @@ pub struct YabridgeFiles { pub yabridge_host_exe_so: PathBuf, } +impl Default for Config { + fn default() -> Self { + Config { + method: InstallationMethod::Copy, + yabridge_home: None, + plugin_dirs: BTreeSet::new(), + no_verify: false, + last_known_config: None, + } + } +} + impl Config { /// Try to read the config file, creating a new default file if necessary. This will fail if the /// file could not be created or if it could not be parsed. @@ -158,12 +174,7 @@ impl Config { .with_context(|| format!("Failed to parse '{}'", path.display())) } None => { - let defaults = Config { - method: InstallationMethod::Copy, - yabridge_home: None, - plugin_dirs: BTreeSet::new(), - last_known_config: None, - }; + let defaults = Config::default(); // If no existing config file exists, then write a new config file with default // values diff --git a/tools/yabridgectl/src/main.rs b/tools/yabridgectl/src/main.rs index 6cdb3f2f..0db1bd4a 100644 --- a/tools/yabridgectl/src/main.rs +++ b/tools/yabridgectl/src/main.rs @@ -116,7 +116,17 @@ fn main() -> Result<()> { "Automatically locate yabridge's files. This can be used after manually \ setting a path with the '--path' option to revert back to the default \ auto detection behaviour.", + ), + ).arg( + Arg::with_name("no_verify") + .long("no-verify") + .about("Always skip post-installation setup checks") + .long_about( + "Always skip post-installation setup checks. This can be set temporarily \ + by passing the '--no-verify' option to 'yabridgectl sync'.", ) + .possible_values(&["true", "false"]) + .takes_value(true), ), ) .subcommand( @@ -177,6 +187,7 @@ fn main() -> Result<()> { .ok() .and_then(|path| path.canonicalize().ok()), path_auto: options.is_present("path_auto"), + no_verify: options.value_of("no_verify").map(|value| value == "true"), }, ), ("sync", Some(options)) => actions::do_sync(