Skip to content

Commit

Permalink
chore: use cross-platform clean script (#10938)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Sep 19, 2023
1 parent 0e612ab commit 86df093
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/browsers/package.json
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build:docs": "wireit",
"build": "wireit",
"clean": "git clean -Xf $(ls -A | grep -v node_modules)",
"clean": "../../tools/clean.js",
"test": "wireit"
},
"bin": "lib/cjs/main-cli.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/ng-schematics/package.json
Expand Up @@ -4,7 +4,7 @@
"description": "Puppeteer Angular schematics",
"scripts": {
"build": "wireit",
"clean": "git clean -Xf $(ls -A | grep -v node_modules)",
"clean": "../../tools/clean.js",
"dev:test": "npm run test --watch",
"dev": "npm run build --watch",
"sandbox:test": "node tools/sandbox.js --test",
Expand Down
2 changes: 1 addition & 1 deletion packages/puppeteer-core/package.json
Expand Up @@ -37,7 +37,7 @@
"build:docs": "wireit",
"build": "wireit",
"check": "tsx tools/ensure-correct-devtools-protocol-package",
"clean": "git clean -Xf $(ls -A | grep -v node_modules)",
"clean": "../../tools/clean.js",
"prepack": "wireit",
"unit": "wireit"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/puppeteer/package.json
Expand Up @@ -36,7 +36,7 @@
"scripts": {
"build:docs": "wireit",
"build": "wireit",
"clean": "git clean -Xf $(ls -A | grep -v node_modules)",
"clean": "../../tools/clean.js",
"postinstall": "node install.js",
"prepack": "wireit"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/testserver/package.json
Expand Up @@ -5,7 +5,7 @@
"main": "lib/index.js",
"scripts": {
"build": "wireit",
"clean": "git clean -Xf $(ls -A | grep -v node_modules)"
"clean": "../../tools/clean.js"
},
"wireit": {
"build": {
Expand Down
2 changes: 1 addition & 1 deletion test/installation/package.json
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"build": "wireit",
"clean": "git clean -Xf $(ls -A | grep -v node_modules)",
"clean": "../../tools/clean.js",
"test": "mocha"
},
"wireit": {
Expand Down
2 changes: 1 addition & 1 deletion test/package.json
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"build": "wireit",
"clean": "git clean -Xf $(ls -A | grep -v node_modules)"
"clean": "../tools/clean.js"
},
"wireit": {
"build": {
Expand Down
12 changes: 12 additions & 0 deletions tools/clean.js
@@ -0,0 +1,12 @@
#!/usr/bin/env node

const {exec} = require('child_process');
const {readdirSync} = require('fs');

exec(
`git clean -Xf ${readdirSync(process.cwd())
.filter(file => {
return file !== 'node_modules';
})
.join(' ')}`
);

0 comments on commit 86df093

Please sign in to comment.