chore: use cross-platform clean script (#10938)

This commit is contained in:
jrandolf 2023-09-19 12:51:09 +02:00 committed by GitHub
parent 0e612ab0a4
commit 86df093824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 7 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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": {

View File

@ -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": {

View File

@ -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": {

12
tools/clean.js Executable file
View File

@ -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(' ')}`
);