Skip to content

Commit

Permalink
Create a CACHEDIR.TAG for Apple target directory
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Sep 10, 2023
1 parent e1c6309 commit 3e3bdfe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/zig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,16 @@ impl Zig {
};
let deps_dir = target_dir.join(profile).join("deps");
fs::create_dir_all(&deps_dir)?;
if !target_dir.join("CACHEDIR.TAG").is_file() {
// Create a CACHEDIR.TAG file to exclude target directory from backup
let _ = fs::write(
target_dir.join("CACHEDIR.TAG"),
"Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir/
",
);
}
fs::write(deps_dir.join("libiconv.tbd"), LIBICONV_TBD)?;
fs::write(deps_dir.join("libcharset.1.tbd"), LIBCHARSET_TBD)?;
fs::write(deps_dir.join("libcharset.tbd"), LIBCHARSET_TBD)?;
Expand Down

0 comments on commit 3e3bdfe

Please sign in to comment.