Skip to content

Commit

Permalink
fix(cache): no longer let remoteCache enable override force
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-olszewski committed Jan 10, 2025
1 parent ad20f12 commit 6e33a81
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/turborepo-lib/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ impl<'a> TryFrom<OptsInputs<'a>> for CacheOpts {
return Err(Error::OverlappingCacheOptions);
}

// defaults to fully enabled cache
let mut cache = cache.unwrap_or_default();

if inputs.config.remote_only() {
Expand All @@ -482,11 +483,10 @@ impl<'a> TryFrom<OptsInputs<'a>> for CacheOpts {
if !is_linked {
cache.remote.read = false;
cache.remote.write = false;
} else if let Some(enabled) = inputs.config.enabled {
// We're linked, but if the user has explicitly enabled or disabled, use that
// value
cache.remote.read = enabled;
cache.remote.write = enabled;
} else if let Some(false) = inputs.config.enabled {
// We're linked, but if the user has explicitly disabled remote cache
cache.remote.read = false;
cache.remote.write = false;
};

if inputs.config.remote_cache_read_only() {
Expand Down

0 comments on commit 6e33a81

Please sign in to comment.