Skip to content

Commit

Permalink
moss: Add a CACHEDIR.TAG to .moss/cache
Browse files Browse the repository at this point in the history
  • Loading branch information
hunger committed Feb 9, 2024
1 parent 4364e12 commit 00cfe03
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/moss/src/installation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,15 @@ fn ensure_dirs_exist(root: &Path) {
] {
let _ = fs::create_dir_all(path);
}
ensure_cachedir_tag(&moss.join("cache"));
}

fn ensure_cachedir_tag(path: &Path) {
let cachedir_tag = path.join("CACHEDIR.TAG");
if !cachedir_tag.exists() {
let _ = std::fs::write(cachedir_tag,
br#"Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by moss.
# For information about cache directory tags see https://bford.info/cachedir/"#);
}
}

0 comments on commit 00cfe03

Please sign in to comment.