File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -719,14 +719,17 @@ pub fn exclude_from_backups_and_indexing(p: impl AsRef<Path>) {
719
719
/// * CACHEDIR.TAG files supported by various tools in a platform-independent way
720
720
fn exclude_from_backups ( path : & Path ) {
721
721
exclude_from_time_machine ( path) ;
722
- let _ = std:: fs:: write (
723
- path. join ( "CACHEDIR.TAG" ) ,
724
- "Signature: 8a477f597d28d172789f06886806bc55
722
+ let file = path. join ( "CACHEDIR.TAG" ) ;
723
+ if !file. exists ( ) {
724
+ let _ = std:: fs:: write (
725
+ file,
726
+ "Signature: 8a477f597d28d172789f06886806bc55
725
727
# This file is a cache directory tag created by cargo.
726
728
# For information about cache directory tags see https://bford.info/cachedir/
727
729
" ,
728
- ) ;
729
- // Similarly to exclude_from_time_machine() we ignore errors here as it's an optional feature.
730
+ ) ;
731
+ // Similarly to exclude_from_time_machine() we ignore errors here as it's an optional feature.
732
+ }
730
733
}
731
734
732
735
/// Marks the directory as excluded from content indexing.
You can’t perform that action at this time.
0 commit comments