Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/open_ocd_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ where
.into_string()
.map_err(|_| "Failed to convert tmp_dir to string.")?;

let cmd = cmd.args(&[
cmd.args(&[
"-s",
&config_folder,
"-s",
Expand All @@ -132,6 +132,15 @@ where
&ws_foler,
]);

// The xpack-bundled OpenOCD ships its standard scripts alongside the
// executable in `<exe_dir>/scripts/`. Our .cfg files reference these via
// `source [find interface/...]`, which only resolves through OpenOCD's
// search path — add the directory if it exists.
let scripts_folder = dirs::get_exe_dir()?.join("scripts");
if scripts_folder.is_dir() {
cmd.arg("-s").arg(&scripts_folder);
}

let mut child = cmd
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down