MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / current_executable_path

Function current_executable_path

packages/server/src/service.rs:421–436  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

419}
420
421fn current_executable_path() -> anyhow::Result<PathBuf> {
422 if let Some(arg0) = env::args_os().next().filter(|value| !value.is_empty()) {
423 let path = PathBuf::from(arg0);
424 let candidate = if path.is_absolute() {
425 path
426 } else {
427 env::current_dir()
428 .context("resolve current directory")?
429 .join(path)
430 };
431 if candidate.exists() {
432 return Ok(candidate);
433 }
434 }
435 env::current_exe().context("resolve current executable path")
436}
437
438fn argument_value(arguments: &[String], name: &str) -> Option<String> {
439 arguments

Callers 1

installFunction · 0.85

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected