Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-config/src/env.rs')
-rw-r--r--helix-config/src/env.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/helix-config/src/env.rs b/helix-config/src/env.rs
new file mode 100644
index 00000000..537db384
--- /dev/null
+++ b/helix-config/src/env.rs
@@ -0,0 +1,10 @@
+// TOOD: move to stdx
+
+pub fn binary_exists(binary_name: &str) -> bool {
+ which::which(binary_name).is_ok()
+}
+
+#[cfg(not(windows))]
+pub fn env_var_is_set(env_var_name: &str) -> bool {
+ std::env::var_os(env_var_name).is_some()
+}