Skip to content

Commit a82a6a5

Browse files
committed
fix: also move when restoring cache
1 parent cb01d0c commit a82a6a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugin/src/helpers/cache.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function saveCache({
2222

2323
const cacheDirs = getCacheDirs(publish)
2424

25-
// @ts-expect-error - `move` is not in the types, but should be passed through to @netlify/cache-utils that support this option
25+
// @ts-expect-error - `move` is not in the types, but it is passed through to @netlify/cache-utils that support this option
2626
if (await utils.cache.save(cacheDirs, { move: true })) {
2727
utils.status.show({
2828
title: 'Essential Gatsby Build Plugin ran successfully',
@@ -40,7 +40,8 @@ export async function restoreCache({ publish, utils }): Promise<void> {
4040

4141
const cacheDirs = getCacheDirs(publish)
4242

43-
if (await utils.cache.restore(cacheDirs)) {
43+
// @ts-expect-error - `move` is not in the types, but it is passed through to @netlify/cache-utils that support this option
44+
if (await utils.cache.restore(cacheDirs, { move: true })) {
4445
console.log('Found a Gatsby cache. We’re about to go FAST. ⚡️')
4546
} else {
4647
console.log('No Gatsby cache found. Building fresh.')

0 commit comments

Comments
 (0)