aboutsummaryrefslogtreecommitdiff
path: root/helix-loader/src/lib.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-06-21 16:59:02 +0000
committerGitHub2022-06-21 16:59:02 +0000
commit19dccade7c44619bfa414a711fe72a612e4ca358 (patch)
treed0a502bc095c1619cfb94236782f42d595af0197 /helix-loader/src/lib.rs
parenta17626a822b36d4de3146c2d410f976e19dd189c (diff)
parent458b89e21dcf76bbf9ca6ba237bd334f4922722d (diff)
Merge pull request #2359 from dead10ck/test-harness
Integration testing harness
Diffstat (limited to 'helix-loader/src/lib.rs')
-rw-r--r--helix-loader/src/lib.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs
index 767bff7a..ff4414b2 100644
--- a/helix-loader/src/lib.rs
+++ b/helix-loader/src/lib.rs
@@ -11,17 +11,19 @@ pub fn runtime_dir() -> std::path::PathBuf {
return dir.into();
}
+ if let Ok(dir) = std::env::var("CARGO_MANIFEST_DIR") {
+ // this is the directory of the crate being run by cargo, we need the workspace path so we take the parent
+ let path = std::path::PathBuf::from(dir).parent().unwrap().join(RT_DIR);
+ log::debug!("runtime dir: {}", path.to_string_lossy());
+ return path;
+ }
+
const RT_DIR: &str = "runtime";
let conf_dir = config_dir().join(RT_DIR);
if conf_dir.exists() {
return conf_dir;
}
- if let Ok(dir) = std::env::var("CARGO_MANIFEST_DIR") {
- // this is the directory of the crate being run by cargo, we need the workspace path so we take the parent
- return std::path::PathBuf::from(dir).parent().unwrap().join(RT_DIR);
- }
-
// fallback to location of the executable being run
std::env::current_exe()
.ok()