From e49128388e3b2f73523d82bf7f16fa1eae019c37 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 11 Mar 2026 15:01:55 +0800 Subject: Fix handling of dot dir names in find_space_root_with --- systems/_framework/src/space.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'systems/_framework') diff --git a/systems/_framework/src/space.rs b/systems/_framework/src/space.rs index 8a82467..47d3c0d 100644 --- a/systems/_framework/src/space.rs +++ b/systems/_framework/src/space.rs @@ -374,6 +374,21 @@ pub fn find_space_root(pattern: SpaceRootFindPattern) -> Result bool> = match pattern { SpaceRootFindPattern::IncludeDotDir(dot_dir_name) => Box::new(move |path| { - path.join(format!(".{}", dot_dir_name.to_string_lossy())) - .is_dir() + let dir_name = dot_dir_name.to_string_lossy(); + let dir_name = if dir_name.starts_with('.') { + dir_name.to_string() + } else { + format!(".{}", dir_name) + }; + path.join(dir_name).is_dir() }), SpaceRootFindPattern::IncludeFile(file_name) => { Box::new(move |path| path.join(&file_name).is_file()) -- cgit