Skip to content

Commit

Permalink
Added local filter for hidden paths inside $HOME directory (metalbear…
Browse files Browse the repository at this point in the history
…-co#2950)

* Added local filter for hidden paths inside HOME directory

* Fix trailing slash case
  • Loading branch information
Razz4780 authored Dec 2, 2024
1 parent 3f0df1b commit a200aeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/+hidden-home-files-filter.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hidden files and directories in `$HOME` directory are now read locally by default.
8 changes: 8 additions & 0 deletions mirrord/layer/src/file/filter/read_local_by_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,13 @@ pub fn regex_set_builder() -> RegexSetBuilder {
patterns.push(format!("{}$", regex::escape(&executable.to_string_lossy())));
}

// Hidden files and directories in $HOME.
if let Ok(home) = env::var("HOME") {
patterns.push(format!(
"^{}/\\.",
regex::escape(home.trim_end_matches('/'))
))
}

RegexSetBuilder::new(patterns)
}

0 comments on commit a200aeb

Please sign in to comment.