diff options
author | Blaž Hrastnik | 2022-06-21 16:59:02 +0000 |
---|---|---|
committer | GitHub | 2022-06-21 16:59:02 +0000 |
commit | 19dccade7c44619bfa414a711fe72a612e4ca358 (patch) | |
tree | d0a502bc095c1619cfb94236782f42d595af0197 /helix-loader | |
parent | a17626a822b36d4de3146c2d410f976e19dd189c (diff) | |
parent | 458b89e21dcf76bbf9ca6ba237bd334f4922722d (diff) |
Merge pull request #2359 from dead10ck/test-harness
Integration testing harness
Diffstat (limited to 'helix-loader')
-rw-r--r-- | helix-loader/Cargo.toml | 1 | ||||
-rw-r--r-- | helix-loader/src/lib.rs | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/helix-loader/Cargo.toml b/helix-loader/Cargo.toml index 20384472..3d8a697c 100644 --- a/helix-loader/Cargo.toml +++ b/helix-loader/Cargo.toml @@ -20,7 +20,6 @@ toml = "0.5" etcetera = "0.4" tree-sitter = "0.20" once_cell = "1.12" - log = "0.4" # TODO: these two should be on !wasm32 only 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() |