diff --git a/changelog.d/+hidden-home-files-filter.changed.md b/changelog.d/+hidden-home-files-filter.changed.md new file mode 100644 index 00000000000..664d2ad0c92 --- /dev/null +++ b/changelog.d/+hidden-home-files-filter.changed.md @@ -0,0 +1 @@ +Hidden files and directories in `$HOME` directory are now read locally by default. \ No newline at end of file diff --git a/mirrord/layer/src/file/filter/read_local_by_default.rs b/mirrord/layer/src/file/filter/read_local_by_default.rs index e199cfb55c6..a51bd4901b3 100644 --- a/mirrord/layer/src/file/filter/read_local_by_default.rs +++ b/mirrord/layer/src/file/filter/read_local_by_default.rs @@ -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) }