fix(desktop): add workaround for nushell
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
use tauri::{path::BaseDirectory, AppHandle, Manager};
|
use tauri::{AppHandle, Manager, path::BaseDirectory};
|
||||||
use tauri_plugin_shell::{process::Command, ShellExt};
|
use tauri_plugin_shell::{ShellExt, process::Command};
|
||||||
|
|
||||||
const CLI_INSTALL_DIR: &str = ".opencode/bin";
|
const CLI_INSTALL_DIR: &str = ".opencode/bin";
|
||||||
const CLI_BINARY_NAME: &str = "opencode";
|
const CLI_BINARY_NAME: &str = "opencode";
|
||||||
@@ -164,11 +164,18 @@ pub fn create_command(app: &tauri::AppHandle, args: &str) -> Command {
|
|||||||
return {
|
return {
|
||||||
let sidecar = get_sidecar_path(app);
|
let sidecar = get_sidecar_path(app);
|
||||||
let shell = get_user_shell();
|
let shell = get_user_shell();
|
||||||
|
|
||||||
|
let cmd = if shell.ends_with("/nu") {
|
||||||
|
format!("^\"{}\" {}", sidecar.display(), args)
|
||||||
|
} else {
|
||||||
|
format!("\"{}\" {}", sidecar.display(), args)
|
||||||
|
};
|
||||||
|
|
||||||
app.shell()
|
app.shell()
|
||||||
.command(&shell)
|
.command(&shell)
|
||||||
.env("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY", "true")
|
.env("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY", "true")
|
||||||
.env("OPENCODE_CLIENT", "desktop")
|
.env("OPENCODE_CLIENT", "desktop")
|
||||||
.env("XDG_STATE_HOME", &state_dir)
|
.env("XDG_STATE_HOME", &state_dir)
|
||||||
.args(["-il", "-c", &format!("\"{}\" {}", sidecar.display(), args)])
|
.args(["-il", "-c", &cmd])
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user