diff --git a/.oxrls/076b-waxy-goat.md b/.oxrls/076b-waxy-goat.md deleted file mode 100644 index cf82ff0..0000000 --- a/.oxrls/076b-waxy-goat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@bdbchgg/oxrls": "patch" ---- - -Fixed a bug where the Changelog headline would not stick at the top of the changelog file \ No newline at end of file diff --git a/.oxrls/.oxrls/882f-useful-mouse.md b/.oxrls/4303-glad-wood.md similarity index 100% rename from .oxrls/.oxrls/882f-useful-mouse.md rename to .oxrls/4303-glad-wood.md diff --git a/src/config.rs b/src/config.rs index 690e109..1e9f46f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -224,16 +224,18 @@ impl OxrlsConfig { } /// Find the config dir (the release_dir relative to config file location or cwd). + /// If the config file is already inside the release directory, returns the + /// config's parent directory directly to avoid double-joining. pub fn release_dir_abs(&self, config_path: &Path) -> PathBuf { let base = config_path.parent().unwrap_or_else(|| Path::new(".")); - // If the config is already inside the release directory, use the config's parent directly. - // Otherwise, join the release_dir relative to the config's parent. - let release_path = base.join(&self.release_dir); - if release_path == base { - // Config is inside release dir — don't double-join + // If the config's parent directory already has the release_dir name, or if + // the release_dir is ".", use the parent directly. + if self.release_dir == "." || self.release_dir.is_empty() { + base.to_path_buf() + } else if base.file_name().and_then(|n| n.to_str()) == Some(self.release_dir.as_str()) { base.to_path_buf() } else { - release_path + base.join(&self.release_dir) } }