fix: allow includes to include top level files

This commit is contained in:
daimond113 2024-11-30 11:31:17 +01:00
parent e5e2bbeeb4
commit 564d9de675
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C
2 changed files with 6 additions and 3 deletions

View file

@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Fix `includes` not supporting root files by @daimond113
## [0.5.0-rc.13] - 2024-11-28
### Added
- Print that no updates are available in `outdated` command by @daimond113

View file

@ -255,11 +255,10 @@ pub async fn matching_globs_old_behaviour<'a, P: AsRef<Path>, I: IntoIterator<It
let path = entry.path();
let relative_path = path.strip_prefix(dir.as_ref()).unwrap();
let file_name = path.file_name().unwrap();
let mut is_filename_match = false;
let is_filename_match =
is_root && file_name.to_str().is_some_and(|s| file_names.contains(s));
if entry.file_type().await?.is_dir() {
is_filename_match =
is_root && file_name.to_str().is_some_and(|s| file_names.contains(s));
read_dirs.push((
fs::read_dir(&path).await?,
is_entire_dir_included || is_filename_match,