mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-21 14:54:46 +00:00
fix(mcp): add back use std::env, use compile-time #[cfg] for locate_mcp_bin
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::time::Duration;
|
||||
@@ -91,10 +92,14 @@ fn installed_mcp_version() -> Option<String> {
|
||||
}
|
||||
|
||||
fn locate_mcp_bin() -> Option<String> {
|
||||
if cfg!(windows) {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
return locate_windows_command("dbx-mcp-server");
|
||||
}
|
||||
command_stdout("which", &["dbx-mcp-server"]).ok().and_then(first_non_empty_line)
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
command_stdout("which", &["dbx-mcp-server"]).ok().and_then(first_non_empty_line)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
|
||||
Reference in New Issue
Block a user