coliru

A minimal, flexible, dotfile installer
git clone https://git.ashermorgan.net/coliru/
Log | Files | Refs | README

commit 224e54d0b677e3af2216a201ebf950ee7de9df72
parent 74083aad6d0505631f561f33ef057dd37ff814a2
Author: Asher Morgan <59518073+ashermorgan@users.noreply.github.com>
Date:   Sun, 23 Jun 2024 20:10:56 -0700

Fix bug affecting manifests in current directory

Diffstat:
Msrc/manifest.rs | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/manifest.rs b/src/manifest.rs @@ -51,7 +51,10 @@ pub fn parse_manifest_file(path: &Path) -> Result<Manifest, String> { let raw_str = read_to_string(path).map_err(|why| why.to_string())?; let raw_manifest = serde_yaml::from_str::<RawManifest>(&raw_str) .map_err(|why| why.to_string())?; - let base_dir = path.parent().or_else(|| Some(&Path::new("."))).unwrap(); + let base_dir = match path.parent() { + None => &Path::new("."), + Some(p) => if p == Path::new("") { &Path::new(".") } else { p }, + }; Ok(Manifest { steps: raw_manifest.steps,