Returns the absolute path into the workspaces target directory to locate the desired executable. # Arguments - `cmd`: workspace binary, e.g. `ch-remote` or `cloud-hypervisor`
(cmd: &str)
| 2076 | /// # Arguments |
| 2077 | /// - `cmd`: workspace binary, e.g. `ch-remote` or `cloud-hypervisor` |
| 2078 | pub fn clh_command(cmd: &str) -> String { |
| 2079 | let workspace_root = workspace_root(); |
| 2080 | let rustc_target = env::var("BUILD_TARGET").unwrap_or("x86_64-unknown-linux-gnu".to_string()); |
| 2081 | let target_artifact_dir = format!("target/{rustc_target}/release"); |
| 2082 | let target_cmd_path = format!("{target_artifact_dir}/{cmd}"); |
| 2083 | |
| 2084 | let full_path = workspace_root.join(&target_cmd_path); |
| 2085 | String::from(full_path.to_str().unwrap()) |
| 2086 | } |
| 2087 | |
| 2088 | pub fn remote_command(api_socket: &str, command: &str, arg: Option<&str>) -> bool { |
| 2089 | let mut cmd = Command::new(clh_command("ch-remote")); |