Skip to content

Commit

Permalink
[Optimize] Add npm run clear (cocos#10879)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1779239)

Co-authored-by: Sijie <[email protected]>
  • Loading branch information
VisualSJ and VisualSJ authored May 14, 2022
1 parent e9ea353 commit e3505cb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"checkout-engine-version": "node ./scripts/checkout-engine-version.js",
"varify-engine-version": "node ./scripts/varify-engine-version.js",
"fetch-ral": "node ./scripts/fetch-ral.js",
"clear": "node ./scripts/clear.js",
"clear-platform": "node ./native/utils/clear-platform.js",
"update:native-external": "node ./native/utils/update-external.js",
"test": "gulp test",
Expand Down
19 changes: 19 additions & 0 deletions scripts/clear.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

const { removeSync } = require('fs-extra');
const { join } = require('path');

try {
console.log('Deleting The Build Cache');
removeSync(join(__dirname, '../bin'));

console.log('Deleting Debugging Information');
removeSync(join(__dirname, '../DebugInfos.json'));

console.log('Deleting `node_modules`');
removeSync(join(__dirname, '../node_modules'));

} catch(error) {
console.error(error);
process.exit(-1);
}

0 comments on commit e3505cb

Please sign in to comment.