2024-11-13 17:20:36 -08:00
|
|
|
// Copyright 2024 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
const fastGlob = require('fast-glob');
|
|
|
|
const { rm } = require('node:fs/promises');
|
|
|
|
const { join } = require('node:path');
|
|
|
|
|
|
|
|
const repoRoot = join(__dirname, '..');
|
|
|
|
|
|
|
|
const PATTERNS = [
|
|
|
|
'sticker-creator/dist',
|
|
|
|
'app/**/*.js',
|
|
|
|
'app/*.js',
|
|
|
|
'ts/**/*.js',
|
|
|
|
'bundles',
|
|
|
|
'tsconfig.tsbuildinfo',
|
|
|
|
'preload.bundle.js',
|
|
|
|
'preload.bundle.cache',
|
2025-09-17 11:24:31 -05:00
|
|
|
'.eslintcache',
|
2024-11-13 17:20:36 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
const readable = fastGlob.stream(PATTERNS, {
|
|
|
|
cwd: repoRoot,
|
|
|
|
});
|
|
|
|
|
|
|
|
const promises = [];
|
|
|
|
for await (const entry of readable) {
|
|
|
|
promises.push(rm(entry, { recursive: true, force: true }));
|
|
|
|
}
|
|
|
|
await Promise.all(promises);
|
|
|
|
}
|
|
|
|
|
|
|
|
main().catch(error => {
|
|
|
|
console.error(error);
|
|
|
|
process.exit(1);
|
|
|
|
});
|