From 3920151bfe12f23c1b3a1a96f23f121a0f7c5343 Mon Sep 17 00:00:00 2001 From: pryme-svg Date: Mon, 7 Dec 2020 20:20:31 -0800 Subject: [PATCH] Try to catch --- scripts/build.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 98c30a5..8e2c8dd 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -109,7 +109,12 @@ async function main(){ console.info("Starting build") console.info("Reseting existent directory...") - await fs.promises.rmdir("./distApp", {"recursive": true}) + try{ + await fs.promises.rmdir("./distApp", {"recursive": true}) + } catch (error) { + console.error(error); + } + await fs.promises.mkdir(PROJECT_DIR+"/distApp/dist", {"recursive": true}) console.info("Executing command `npm run compile`") @@ -278,4 +283,4 @@ main() .catch(err => { console.error(err) process.exit(1) -}) \ No newline at end of file +})