mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
5f366088be
This seems more reliable nowadays as rimraf. https://github.com/microsoft/playwright/issues/27712 --------- Signed-off-by: Max Schmitt <max@schmitt.mx>
18 lines
620 B
JavaScript
18 lines
620 B
JavaScript
// @ts-check
|
|
const { workspace } = require('../workspace');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const rmSync = (dir) => fs.rmSync(dir, { recursive: true, force: true, maxRetries: 10 });
|
|
|
|
for (const pkg of workspace.packages()) {
|
|
rmSync(path.join(pkg.path, 'node_modules'));
|
|
rmSync(path.join(pkg.path, 'lib'));
|
|
rmSync(path.join(pkg.path, 'src', 'generated'));
|
|
const bundles = path.join(pkg.path, 'bundles');
|
|
if (fs.existsSync(bundles) && fs.statSync(bundles).isDirectory()) {
|
|
for (const bundle of fs.readdirSync(bundles))
|
|
rmSync(path.join(bundles, bundle, 'node_modules'));
|
|
}
|
|
}
|