mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
[yabridgectl] Allow permanently disabling checks
This commit is contained in:
@@ -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
|
- Added the `yabridgectl set --path-auto` option to revert back to automatically
|
||||||
locating yabridge's files after manually setting a path with
|
locating yabridge's files after manually setting a path with
|
||||||
`yabridgectl set --path=<...>`.
|
`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
|
## [2.2.1] - 2020-12-12
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ pub struct SetOptions<'a> {
|
|||||||
pub method: Option<&'a str>,
|
pub method: Option<&'a str>,
|
||||||
pub path: Option<PathBuf>,
|
pub path: Option<PathBuf>,
|
||||||
pub path_auto: bool,
|
pub path_auto: bool,
|
||||||
|
pub no_verify: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Change configuration settings. The actual options are defined in the clap [app](clap::App).
|
/// 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;
|
config.yabridge_home = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(no_verify) = options.no_verify {
|
||||||
|
config.no_verify = no_verify;
|
||||||
|
}
|
||||||
|
|
||||||
config.write()
|
config.write()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,7 +388,9 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
|||||||
num_skipped_files
|
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(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ const YABRIDGE_VST3_HOME: &str = ".vst3/yabridge";
|
|||||||
/// The configuration used for yabridgectl. This will be serialized to and deserialized from
|
/// The configuration used for yabridgectl. This will be serialized to and deserialized from
|
||||||
/// `$XDG_CONFIG_HOME/yabridge/config.toml`.
|
/// `$XDG_CONFIG_HOME/yabridge/config.toml`.
|
||||||
#[derive(Deserialize, Serialize, Debug)]
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
|
#[serde(default)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
/// The installation method to use. We will default to creating copies since that works
|
/// The installation method to use. We will default to creating copies since that works
|
||||||
/// everywhere.
|
/// 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
|
/// 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.
|
/// duplicates and the config file is always sorted.
|
||||||
pub plugin_dirs: BTreeSet<PathBuf>,
|
pub plugin_dirs: BTreeSet<PathBuf>,
|
||||||
|
/// 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.
|
/// 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)
|
/// This is mostly to diagnose issues with older Wine versions (such as those in Ubuntu's repos)
|
||||||
/// early on.
|
/// early on.
|
||||||
@@ -144,6 +148,18 @@ pub struct YabridgeFiles {
|
|||||||
pub yabridge_host_exe_so: PathBuf,
|
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 {
|
impl Config {
|
||||||
/// Try to read the config file, creating a new default file if necessary. This will fail if the
|
/// 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.
|
/// 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()))
|
.with_context(|| format!("Failed to parse '{}'", path.display()))
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let defaults = Config {
|
let defaults = Config::default();
|
||||||
method: InstallationMethod::Copy,
|
|
||||||
yabridge_home: None,
|
|
||||||
plugin_dirs: BTreeSet::new(),
|
|
||||||
last_known_config: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
// If no existing config file exists, then write a new config file with default
|
// If no existing config file exists, then write a new config file with default
|
||||||
// values
|
// values
|
||||||
|
|||||||
@@ -116,7 +116,17 @@ fn main() -> Result<()> {
|
|||||||
"Automatically locate yabridge's files. This can be used after manually \
|
"Automatically locate yabridge's files. This can be used after manually \
|
||||||
setting a path with the '--path' option to revert back to the default \
|
setting a path with the '--path' option to revert back to the default \
|
||||||
auto detection behaviour.",
|
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(
|
.subcommand(
|
||||||
@@ -177,6 +187,7 @@ fn main() -> Result<()> {
|
|||||||
.ok()
|
.ok()
|
||||||
.and_then(|path| path.canonicalize().ok()),
|
.and_then(|path| path.canonicalize().ok()),
|
||||||
path_auto: options.is_present("path_auto"),
|
path_auto: options.is_present("path_auto"),
|
||||||
|
no_verify: options.value_of("no_verify").map(|value| value == "true"),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
("sync", Some(options)) => actions::do_sync(
|
("sync", Some(options)) => actions::do_sync(
|
||||||
|
|||||||
Reference in New Issue
Block a user