aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--crates/mozart/src/commands/clear_cache.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/mozart/src/commands/clear_cache.rs b/crates/mozart/src/commands/clear_cache.rs
index b9a9303..0740c85 100644
--- a/crates/mozart/src/commands/clear_cache.rs
+++ b/crates/mozart/src/commands/clear_cache.rs
@@ -17,7 +17,7 @@ pub async fn execute(
// Build the list of (key, path) pairs to process.
// cache-dir is only included in full clear mode, not GC mode.
- let mut cache_paths: Vec<(&str, &std::path::PathBuf)> = vec![
+ let mut cache_paths = vec![
("cache-vcs-dir", &config.cache_vcs_dir),
("cache-repo-dir", &config.cache_repo_dir),
("cache-files-dir", &config.cache_files_dir),
@@ -27,12 +27,6 @@ pub async fn execute(
}
for (key, path) in &cache_paths {
- // Read-only guard: skip with informational message
- if config.read_only {
- console.info(&format!("Cache is not enabled ({key}): {}", path.display()));
- continue;
- }
-
// Non-existent directory: skip with informational message
if !path.exists() {
console.info(&format!(
@@ -42,6 +36,12 @@ pub async fn execute(
continue;
}
+ // Read-only guard: skip with informational message
+ if config.read_only {
+ console.info(&format!("Cache is not enabled ({key}): {}", path.display()));
+ continue;
+ }
+
if args.gc {
console.info(&format!(
"Garbage-collecting cache ({key}): {}",