Skip to content

Commit

Permalink
update glob check
Browse files Browse the repository at this point in the history
  • Loading branch information
bytedeveloperr committed Mar 10, 2023
1 parent 618451e commit 58356a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fn parse_members(value: TomlValue) -> Result<Members> {
for member in v.into_iter() {
let path_string = parse_string(member)?;

if path_string.contains("*") {
if path::is_glob_pattern(&path_string) {
let paths = path::expand_glob(&root_path, &path_string)?;

for path in paths {
Expand Down
4 changes: 4 additions & 0 deletions core/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pub fn expand_glob(base_path: &Path, pattern: &str) -> Result<Vec<PathBuf>> {
Ok(paths)
}

pub fn is_glob_pattern(pattern: &str) -> bool {
pattern.contains(&['*', '?', '[', ']'][..])
}

pub fn get_root_path() -> Result<PathBuf> {
let mut current = env::current_dir()?;

Expand Down

0 comments on commit 58356a6

Please sign in to comment.