File tree Expand file tree Collapse file tree
crates/opi-coding-agent/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,10 +9,18 @@ use std::process::Command;
99fn opi_bin ( ) -> String {
1010 let manifest = std:: path:: PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
1111 let workspace_root = manifest. parent ( ) . unwrap ( ) . parent ( ) . unwrap ( ) ;
12- let mut path = workspace_root. join ( "target/release/opi" ) ;
13- if cfg ! ( windows) {
14- path. set_extension ( "exe" ) ;
15- }
12+
13+ // Prefer release binary, fall back to debug when running tests locally or in CI
14+ let exe_name = if cfg ! ( windows) { "opi.exe" } else { "opi" } ;
15+ let release = workspace_root. join ( "target/release" ) . join ( exe_name) ;
16+ let debug = workspace_root. join ( "target/debug" ) . join ( exe_name) ;
17+
18+ let path = if release. exists ( ) {
19+ release
20+ } else {
21+ debug
22+ } ;
23+
1624 path. to_string_lossy ( ) . into_owned ( )
1725}
1826
You can’t perform that action at this time.
0 commit comments