Skip to content

Commit b6e5b16

Browse files
author
Dean Sharon
committed
Fix OrbStack detection using correct CLI syntax
The OrbStack CLI uses subcommands, not flags: - `orb version` instead of `orb --version` Also parse version output correctly from "Version: 2.0.5 (2000500)" to extract just "2.0.5".
1 parent cfa657e commit b6e5b16

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/orchestration/orbstack.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl OrbStack {
2121
/// Check if OrbStack is installed
2222
pub async fn is_installed() -> bool {
2323
Command::new("orb")
24-
.arg("--version")
24+
.arg("version")
2525
.stdout(Stdio::null())
2626
.stderr(Stdio::null())
2727
.status()
@@ -47,15 +47,23 @@ impl OrbStack {
4747
/// Get OrbStack version
4848
pub async fn version() -> MinotaurResult<String> {
4949
let output = Command::new("orb")
50-
.arg("--version")
50+
.arg("version")
5151
.stdout(Stdio::piped())
5252
.stderr(Stdio::piped())
5353
.output()
5454
.await
55-
.map_err(|e| MinotaurError::command_failed("orb --version", e))?;
55+
.map_err(|e| MinotaurError::command_failed("orb version", e))?;
5656

5757
if output.status.success() {
58-
Ok(String::from_utf8_lossy(&output.stdout).trim().to_string())
58+
// Parse "Version: 2.0.5 (2000500)" to just "2.0.5"
59+
let stdout = String::from_utf8_lossy(&output.stdout);
60+
let version = stdout
61+
.lines()
62+
.find(|l| l.starts_with("Version:"))
63+
.and_then(|l| l.strip_prefix("Version:"))
64+
.map(|v| v.split_whitespace().next().unwrap_or("unknown"))
65+
.unwrap_or("unknown");
66+
Ok(version.to_string())
5967
} else {
6068
Err(MinotaurError::OrbStackNotFound)
6169
}

0 commit comments

Comments
 (0)