From 777b5d1d9f069c6718059aa19beabddf42494757 Mon Sep 17 00:00:00 2001 From: Zach Bloomquist Date: Fri, 10 Jun 2022 22:39:03 -0400 Subject: [PATCH] add fse.remove --- scripts/circle-cache.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/circle-cache.js b/scripts/circle-cache.js index d4fbb0fb0d35..47ce7276677d 100644 --- a/scripts/circle-cache.js +++ b/scripts/circle-cache.js @@ -66,12 +66,13 @@ async function prepareCircleCache () { await Promise.all( paths.map(async (src) => { - await fsExtra.move( - src, - src - .replace(/(.*?)\/node_modules/, '$1_node_modules') - .replace(BASE_DIR, CACHE_DIR), - ) + const dest = src + .replace(/(.*?)\/node_modules/, '$1_node_modules') + .replace(BASE_DIR, CACHE_DIR) + + // self-hosted M1 doesn't always clear this directory between runs, so remove it + await fsExtra.remove(dest) + await fsExtra.move(src, dest) }), )