From 266d6f6d876ab3eb020b88ef6caee0f91776db37 Mon Sep 17 00:00:00 2001 From: akbash Date: Wed, 16 Sep 2026 23:22:37 +0300 Subject: fix: respect opencode tui.json registrations (#4250) refs #4240 Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com> Co-authored-by: JJ Liebig --- src/integration/targets.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/integration/targets.rs') diff --git a/src/integration/targets.rs b/src/integration/targets.rs index 6cb90c18..ec605866 100644 --- a/src/integration/targets.rs +++ b/src/integration/targets.rs @@ -29,7 +29,7 @@ use super::file_ops::{ make_executable, remove_dir_all_if_exists, remove_file_if_exists, remove_legacy_bash_hook_file, }; use super::opencode_config::{ - add_cli_plugin, add_tui_plugin, remove_cli_plugin, remove_tui_plugin, tui_config_path, + add_cli_plugin, add_tui_plugin, remove_cli_plugin, remove_tui_plugin, validate_tui_plugin_config, }; use super::types::{ @@ -461,7 +461,7 @@ pub(crate) fn install_droid() -> io::Result { pub(crate) fn install_opencode() -> io::Result { let dir = opencode_dir()?; - check_config_targets(&dir, &["tui.jsonc", "cli.json"])?; + check_config_targets(&dir, &["tui.jsonc", "tui.json", "cli.json"])?; if !dir.is_dir() { return Err(io::Error::other(format!( "opencode config directory not found at {}. install opencode first", @@ -844,8 +844,7 @@ pub(crate) fn uninstall_droid() -> io::Result { pub(crate) fn uninstall_opencode() -> io::Result { let dir = opencode_dir()?; - check_config_targets(&dir, &["tui.jsonc", "cli.json"])?; - let tui_config_path = tui_config_path(&dir); + check_config_targets(&dir, &["tui.jsonc", "tui.json", "cli.json"])?; let plugin_path = dir.join("plugins").join(OPENCODE_PLUGIN_INSTALL_NAME); let tui_plugin_path = dir.join(OPENCODE_TUI_PLUGIN_INSTALL_NAME); let mut errors = Vec::new(); @@ -858,10 +857,10 @@ pub(crate) fn uninstall_opencode() -> io::Result { errors.push(format!("failed to remove {}: {err}", v2_dir.display())); false }); - let updated_tui_config = + let updated_tui_configs = remove_tui_plugin(&dir, OPENCODE_TUI_PLUGIN_SPEC).unwrap_or_else(|err| { errors.push(err.to_string()); - false + Vec::new() }); let removed_plugin = remove_file_if_exists(&plugin_path).unwrap_or_else(|err| { errors.push(format!("failed to remove {}: {err}", plugin_path.display())); @@ -881,10 +880,9 @@ pub(crate) fn uninstall_opencode() -> io::Result { Ok(OpenCodeUninstallResult { plugin_path, tui_plugin_path, - tui_config_path, removed_plugin, removed_tui_plugin, - updated_tui_config, + updated_tui_configs, }) } -- cgit v1.2.3