Skip to content

Commit

Permalink
fix(cli): Prevent stale command cache defaults (redwoodjs#9169)
Browse files Browse the repository at this point in the history
**Problem**
redwoodjs#9150 highlights that there was a mistake in the cache loading logic.

**Changes**
1. We merge the current cache state with the defaults - this will ensure
that the defaults which are hard coded cannot be missing when the user
updates versions.

**Notes**
I'm updating some of this plugin loading logic so expect a little churn
in this code.
  • Loading branch information
Josh-Walker-GM authored Sep 14, 2023
1 parent 9d63d08 commit 16e1c13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/cli/src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ export async function loadPlugins(yargs) {
valid &&= !Array.isArray(value)
}
if (valid) {
pluginCommandCache = localCommandCache
pluginCommandCache = {
...localCommandCache,
...PLUGIN_CACHE_DEFAULT,
}
}
} catch (error) {
// If the cache file doesn't exist we can just ignore it and continue
Expand Down

0 comments on commit 16e1c13

Please sign in to comment.