Skip to content

Commit

Permalink
Filter via string endsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorma committed Nov 10, 2024
1 parent bb3961b commit 7c0b748
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/todesktop/postInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});

};
Expand Down

0 comments on commit 7c0b748

Please sign in to comment.