From af377c669ce1b07e54243ee62285c669c4f95f93 Mon Sep 17 00:00:00 2001 From: Ben Surgison Date: Mon, 16 May 2022 16:17:26 +0100 Subject: [PATCH] Fix tests on Node 12 Node 12 and below don't have the `fs.rmSync` or `fs.rm` functions, and has limited support for removing a directory recursively. Instead we use `del`, which we include as a dependency anyway. --- build/run-tasks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/run-tasks.js b/build/run-tasks.js index 74861f6562..31f08d3ee7 100644 --- a/build/run-tasks.js +++ b/build/run-tasks.js @@ -1,4 +1,5 @@ const colour = require('nodemon/lib/utils/colour') +const del = require('del') const fs = require('fs') const fse = require('fs-extra') const path = require('path') @@ -25,8 +26,7 @@ function runTasks () { function clean () { // doesn't clean extensions.scss, should it? - fs.rmSync('public', { recursive: true, force: true }) - fs.rmSync('.port.tmp', { force: true }) + del.sync(['public/**', '.port.tmp']) } function sassExtensions () {