rust/hg-core/src/utils.rs
changeset 46483 2845892dd489
parent 46445 ca3f73cc3cf4
child 46505 a25033eb43b5
--- a/rust/hg-core/src/utils.rs	Mon Feb 01 13:32:00 2021 +0100
+++ b/rust/hg-core/src/utils.rs	Thu Feb 04 13:16:21 2021 +0100
@@ -184,3 +184,10 @@
         context: IoErrorContext::CurrentDir,
     })
 }
+
+pub fn current_exe() -> Result<std::path::PathBuf, HgError> {
+    std::env::current_exe().map_err(|error| HgError::IoError {
+        error,
+        context: IoErrorContext::CurrentExe,
+    })
+}