diff options
| author | akbash <akbash@herdr.dev> | 2026-09-16 23:22:37 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-16 22:22:37 +0200 |
| commit | 266d6f6d876ab3eb020b88ef6caee0f91776db37 (patch) | |
| tree | d5ca72f86c30fac4211209a1d2377511e1107fc2 /src/integration/targets.rs | |
| parent | 956f23ff6b72d16fe66169730b76bf565d12d449 (diff) | |
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 <jonathan.liebig@gmail.com>
Diffstat (limited to 'src/integration/targets.rs')
| -rw-r--r-- | src/integration/targets.rs | 14 |
1 files changed, 6 insertions, 8 deletions
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<DroidInstallPaths> { pub(crate) fn install_opencode() -> io::Result<OpenCodeInstallPaths> { 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<DroidUninstallResult> { pub(crate) fn uninstall_opencode() -> io::Result<OpenCodeUninstallResult> { 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<OpenCodeUninstallResult> { 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<OpenCodeUninstallResult> { Ok(OpenCodeUninstallResult { plugin_path, tui_plugin_path, - tui_config_path, removed_plugin, removed_tui_plugin, - updated_tui_config, + updated_tui_configs, }) } |
