From 7c0b748c1c8a33df4ad43d43073f5697629a6949 Mon Sep 17 00:00:00 2001 From: Kendal Cormany Date: Sat, 9 Nov 2024 20:36:44 -0700 Subject: [PATCH] Filter via string endsWith --- scripts/todesktop/postInstall.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/todesktop/postInstall.js b/scripts/todesktop/postInstall.js index 13fb93b7..f4a3eca5 100644 --- a/scripts/todesktop/postInstall.js +++ b/scripts/todesktop/postInstall.js @@ -47,8 +47,10 @@ async function postInstall() { // Remove python stuff await fs.rm(path.join('./assets', 'python'), { recursive: true, force: true }); await fs.rm(path.join('./assets', 'python.tgz'), { force: true }); - (await fs.readdir(path.join('./assets'))).forEach(async (tgzFile) => { - if (path.extname(tgzFile) == '.tar.gz') await fs.rm(path.join('./assets', tgzFile)); + fs.readdirSync(path.join('./assets')).forEach((tgzFile) => { + if (tgzFile.endsWith('.gz')) { + fs.rmSync(path.join('./assets', tgzFile)); + } }); };