Skip to content

Commit

Permalink
Merge pull request #2892 from jarhodes314/2890-remote-access-args
Browse files Browse the repository at this point in the history
Switch to env::args for establishing the executable name
  • Loading branch information
jarhodes314 authored May 22, 2024
2 parents d04d282 + be3f2db commit a8934cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/c8y_remote_access_plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ static SUCCESS_MESSAGE: &str = "CONNECTED";
struct Unreachable<E: std::error::Error + 'static>(#[source] E, &'static str);

async fn spawn_child(command: String, config_dir: &Utf8Path) -> miette::Result<()> {
let exec_path = std::env::current_exe()
.into_diagnostic()
.with_context(|| "Could not get current process executable")?;
let exec_path = std::env::args()
.next()
.ok_or(miette!("Could not get current process executable"))?;

let mut command = tokio::process::Command::new(exec_path)
.args(["--config-dir", config_dir.as_str()])
Expand Down

0 comments on commit a8934cf

Please sign in to comment.