From 45f2769c3c070d1165a421f7f22caac36c1a73f2 Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Sat, 31 Jul 2021 12:52:24 -0400 Subject: [PATCH] improve handling of directory load paths --- src/parse/import.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/parse/import.rs b/src/parse/import.rs index 00616f4..e037e7d 100644 --- a/src/parse/import.rs +++ b/src/parse/import.rs @@ -64,10 +64,14 @@ impl<'a, 'b> Parser<'a, 'b> { for path in &self.options.load_paths { let paths: Vec = if path.is_dir() { vec![ - path.join(format!("{}.scss", name.to_str().unwrap())), - path.join(format!("_{}.scss", name.to_str().unwrap())), - path.join("index.scss"), - path.join("_index.scss"), + path.join(&path_buf) + .with_file_name(name) + .with_extension("scss"), + path.join(&path_buf) + .with_file_name(format!("_{}", name.to_str().unwrap())) + .with_extension("scss"), + path.join(&path_buf).join("index.scss"), + path.join(&path_buf).join("_index.scss"), ] } else { vec![