From efdb826a26be0ed1775d499b9b258e8daa705bc2 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Nov 2021 13:01:22 +0900 Subject: [PATCH] =?UTF-8?q?npm=20script=E3=81=AE=E4=BA=92=E6=8F=9B?= =?UTF-8?q?=E6=80=A7=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- scripts/clean-all.js | 12 ++++++++++++ scripts/clean.js | 6 ------ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 scripts/clean-all.js diff --git a/package.json b/package.json index 86f8a03cb..53288b44c 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "mocha": "cd packages/backend && cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" npx mocha", "test": "npm run mocha", "format": "gulp format", - "clean": "node ./scripts/clean.js" + "clean": "node ./scripts/clean.js", + "clean-all": "node ./scripts/clean-all.js" }, "dependencies": { "@types/gulp": "4.0.9", diff --git a/scripts/clean-all.js b/scripts/clean-all.js new file mode 100644 index 000000000..814ff3f25 --- /dev/null +++ b/scripts/clean-all.js @@ -0,0 +1,12 @@ +const fs = require('fs'); + +(async () => { + fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true }); + fs.rmSync(__dirname + '/../packages/backend/node_modules', { recursive: true, force: true }); + + fs.rmSync(__dirname + '/../packages/client/built', { recursive: true, force: true }); + fs.rmSync(__dirname + '/../packages/client/node_modules', { recursive: true, force: true }); + + fs.rmSync(__dirname + '/../built', { recursive: true, force: true }); + fs.rmSync(__dirname + '/../node_modules', { recursive: true, force: true }); +})(); diff --git a/scripts/clean.js b/scripts/clean.js index 1dca10605..a14f1fb35 100644 --- a/scripts/clean.js +++ b/scripts/clean.js @@ -1,13 +1,7 @@ const fs = require('fs'); -const execa = require('execa'); (async () => { fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/backend/node_modules', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/client/built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/client/node_modules', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../node_modules', { recursive: true, force: true }); })();