Skip to content

Commit

Permalink
Tools: Added clean script
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 committed Oct 10, 2020
1 parent f007735 commit 6c84fdc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Tools/gulp/tasks/deleteBuildDirs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const utils = require('../utils');
const rootDir = utils.rootDir();
const fs = require('fs-extra');

module.exports = {
src: '',
fn: async function() {
await fs.remove(`${rootDir}/CliClient/tests-build`);
await fs.remove(`${rootDir}/CliClient/build`);
},
};
5 changes: 5 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ const tasks = {
copyLib: require('./Tools/gulp/tasks/copyLib'),
tsc: require('./Tools/gulp/tasks/tsc'),
updateIgnoredTypeScriptBuild: require('./Tools/gulp/tasks/updateIgnoredTypeScriptBuild'),
deleteBuildDirs: require('./Tools/gulp/tasks/deleteBuildDirs'),
};

utils.registerGulpTasks(gulp, tasks);

gulp.task('build', gulp.series('copyLib', 'tsc', 'updateIgnoredTypeScriptBuild'));

// The clean task removes build directories and copy back the library. This is useful
// when switching from one branch to another.
gulp.task('clean', gulp.series('deleteBuildDirs', 'copyLib'));
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"watch": "node node_modules/typescript/bin/tsc --watch --project tsconfig.dev.json",
"build": "gulp build",
"setupNewRelease": "node ./Tools/setupNewRelease",
"clean": "npm run clean",
"postinstall": "cd Tools && npm i && cd .. && cd ReactNativeClient && npm i && cd .. && cd ElectronClient && npm i && cd .. && cd CliClient && npm i && cd .. && gulp build"
},
"husky": {
Expand Down

0 comments on commit 6c84fdc

Please sign in to comment.