aboutsummaryrefslogtreecommitdiff
path: root/src/integration/targets.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/integration/targets.rs')
-rw-r--r--src/integration/targets.rs23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/integration/targets.rs b/src/integration/targets.rs
index 0690fc90..d204c552 100644
--- a/src/integration/targets.rs
+++ b/src/integration/targets.rs
@@ -22,13 +22,14 @@ use super::config_edit::{
use super::env::{
antigravity_cli_dir, claude_dir, codex_dir, copilot_dir, cursor_dir, devin_dir, droid_dir,
grok_dir, hermes_dir, hermes_plugin_dir, kilo_dir, kimi_dir, mastracode_dir, omp_extension_dir,
- opencode_dir, pi_extension_dir, qodercli_dir, qwen_dir,
+ opencode_dir, opencode_state_dir, pi_extension_dir, qodercli_dir, qwen_dir,
};
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_tui_plugin, remove_tui_plugin, tui_config_path, validate_tui_plugin_config,
+ add_cli_plugin, add_tui_plugin, remove_cli_plugin, remove_tui_plugin, tui_config_path,
+ validate_tui_plugin_config,
};
use super::types::{
AntigravityCliInstallPaths, AntigravityCliUninstallResult, ClaudeInstallPaths,
@@ -468,11 +469,20 @@ pub(crate) fn install_opencode() -> io::Result<OpenCodeInstallPaths> {
let tui_plugin_path = dir.join(OPENCODE_TUI_PLUGIN_INSTALL_NAME);
fs::write(&tui_plugin_path, OPENCODE_TUI_PLUGIN_ASSET)?;
let tui_config_path = add_tui_plugin(&dir, OPENCODE_TUI_PLUGIN_SPEC)?;
+ let v2_dir = dir.join(super::OPENCODE_V2_TUI_PLUGIN_DIR);
+ fs::create_dir_all(&v2_dir)?;
+ fs::write(v2_dir.join("tui.js"), super::OPENCODE_V2_TUI_PLUGIN_ASSET)?;
+ let cli_config_path = add_cli_plugin(
+ &dir,
+ &opencode_state_dir()?,
+ super::OPENCODE_V2_TUI_PLUGIN_SPEC,
+ )?;
Ok(OpenCodeInstallPaths {
plugin_path,
tui_plugin_path,
tui_config_path,
+ cli_config_path,
})
}
@@ -821,6 +831,15 @@ pub(crate) fn uninstall_opencode() -> io::Result<OpenCodeUninstallResult> {
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();
+ remove_cli_plugin(&dir, super::OPENCODE_V2_TUI_PLUGIN_SPEC).unwrap_or_else(|err| {
+ errors.push(err.to_string());
+ false
+ });
+ let v2_dir = dir.join(super::OPENCODE_V2_TUI_PLUGIN_DIR);
+ remove_dir_all_if_exists(&v2_dir).unwrap_or_else(|err| {
+ errors.push(format!("failed to remove {}: {err}", v2_dir.display()));
+ false
+ });
let updated_tui_config =
remove_tui_plugin(&dir, OPENCODE_TUI_PLUGIN_SPEC).unwrap_or_else(|err| {
errors.push(err.to_string());